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
ff5bb37b72
skia2
/
tests
/
sksl
/
errors
/
UnscopedVariableInDoWhile.glsl
5 lines
85 B
Plaintext
Raw
Normal View
History
Unescape
Escape
Fix fuzzer-discovered error with variable scoping. In GLSL and SkSL, control statements don't require explicit braces around single-statement children. That is, the `match = true` child statement here doesn't need to be braced. if (condition) match = true; Because there are no braces, we never create a Block or a dedicated SymbolTable here. This is normally not a problem, but the fuzzer discovered that it can dump things into the symbol table inside a child statement: if (condition) int newSymbol; This becomes problematic because the symbol name now outlives its block. This means `newSymbol` can be referred to later, which should be illegal (and can cause the optimizer to blow up since the structure is bogus). There doesn't seem to be any reason to allow this code to compile; the user can add an explicit scope here to make it reasonable, and it's (almost) meaningless to declare a symbol that's instantly going to fall out of scope. This code is now rejected with an error message. Change-Id: I44778e5b59652d345b10eecd4c88efbf7d86a5e0 Bug: oss-fuzz:29849 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358960 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-26 15:13:58 +00:00
### Compilation failed:
Fix line numbers of several DSLParser errors Change-Id: I82e0d29fbcb5be93fe20a1fb442e2a429e6cab8e Bug: skia:12411 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445644 Reviewed-by: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-03 21:00:09 +00:00
error: 2: variable 'foo' must be created in a scope
Fix fuzzer-discovered error with variable scoping. In GLSL and SkSL, control statements don't require explicit braces around single-statement children. That is, the `match = true` child statement here doesn't need to be braced. if (condition) match = true; Because there are no braces, we never create a Block or a dedicated SymbolTable here. This is normally not a problem, but the fuzzer discovered that it can dump things into the symbol table inside a child statement: if (condition) int newSymbol; This becomes problematic because the symbol name now outlives its block. This means `newSymbol` can be referred to later, which should be illegal (and can cause the optimizer to blow up since the structure is bogus). There doesn't seem to be any reason to allow this code to compile; the user can add an explicit scope here to make it reasonable, and it's (almost) meaningless to declare a symbol that's instantly going to fall out of scope. This code is now rejected with an error message. Change-Id: I44778e5b59652d345b10eecd4c88efbf7d86a5e0 Bug: oss-fuzz:29849 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358960 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
2021-01-26 15:13:58 +00:00
1 error
Reference in New Issue
Copy Permalink