This website requires JavaScript.
ReeceSX
Explore
Aurora
Register
Sign In
AuroraMiddleware
/
skia2
Watch
1
Star
0
Fork
0
You've already forked skia2
Code
Issues
Pull Requests
Projects
Releases
Wiki
Activity
c973d26854
skia2
/
tests
/
sksl
/
errors
/
ArrayTooManyDimensions.glsl
5 lines
86 B
Plaintext
Raw
Normal View
History
Unescape
Escape
Limit arrays to a maximum of eight dimensions. This addresses a sanitizer issue discovered in https://oss-fuzz.com/testcase-detail/4908118777266176 (it has not been assigned an oss-fuzz bug number yet; coming soon) We need to set some sort of limit here to avoid stack overflow. Eight array dimensions seems like more than enough for any sort of code that we might realistically need, but the limit is definitely flexible if we wanted to increase it. (The fuzzer needed to generate a several- hundred-dimensional array before encountering a crash.) Change-Id: I3630ab40e47cc58a2280ba200b485e1958371fdc Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333160 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-10 15:03:50 +00:00
### Compilation failed:
Add unit test for array with many dimensions. This addresses a sanitizer issue discovered in https://oss-fuzz.com/testcase-detail/4908118777266176 (it has not been assigned an oss-fuzz bug number yet; coming soon) A followup CL will limit array dimensionality to 8. This is an arbitrary choice which is hopefully larger than any reasonable program will need. Change-Id: I4cf05f40ec92c1c3444c71c45f759bb30d7da3c9 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333135 Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-10 15:01:39 +00:00
Remove multi-dimensional array support from the parser. Previously, our AST structures would include a "sizeCount" for arrays, which indicated the number of AST nodes associated with array dimensions. Since GLSL only supports a single array dimension, this field has been replaced with "isArray," a boolean indicating whether we have a single AST node for array size. This allowed many array-size based looping constructs to be replaced with simpler non-looping equivalents. This change flushed out a few places where the parser was not actually enforcing its promised maximum array-dimensionality. Also found some duplicated code in variable-declaration parsing, related to parsing array-sizes and initializer expressions. This has been de-duplicated by using a lambda. (This change was likely why this CL was not net-negative for LOC, but it's simpler and cleaner.) Change-Id: I7abed732d3a296edf02c0ec9813fceb5aae4a9a0 Bug: skia:11026 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340656 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
2020-12-03 19:37:16 +00:00
error: 1: multi-dimensional arrays are not supported
Limit arrays to a maximum of eight dimensions. This addresses a sanitizer issue discovered in https://oss-fuzz.com/testcase-detail/4908118777266176 (it has not been assigned an oss-fuzz bug number yet; coming soon) We need to set some sort of limit here to avoid stack overflow. Eight array dimensions seems like more than enough for any sort of code that we might realistically need, but the limit is definitely flexible if we wanted to increase it. (The fuzzer needed to generate a several- hundred-dimensional array before encountering a crash.) Change-Id: I3630ab40e47cc58a2280ba200b485e1958371fdc Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333160 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
2020-11-10 15:03:50 +00:00
1 error
Reference in New Issue
Copy Permalink