skia2/tests/sksl/errors/Ossfuzz40660.glsl
John Stiles 390edeb88d Fix fuzzer-discovered error with no-op arithmetic.
The fuzzer triggered this error in a strange way that involves parsing a
TK_INVALID token. The fuzzer's original input used \xFF bytes in the
shader text to do this. I replaced these with the ` character since it
behaved the same, but allows our test inputs to remain basic ASCII.

The root problem is that `cast_expression`, part of no-op arithmetic
simplification, can now fail because expressions like `int(4000000000)`
no longer get past Constructor::Convert. Previously we had assumed
`cast_expression` could never return null; now we check its result for
null before using it.

Change-Id: I7335395bab0daf1f788b0c7c154904b2372ae13f
Bug: oss-fuzz:40660
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/467316
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-11-03 14:57:48 +00:00

11 lines
429 B
GLSL

### Compilation failed:
error: 1: unknown identifier 'f'
error: 1: expected ')' to complete function arguments, but found '`'
error: 1: expected ')' to complete expression, but found '`'
error: 1: integer is out of range for type 'int': 3689348940
error: 1: integer is out of range for type 'int': 3689348940
error: 2: expected ']' to complete array access expression, but found ''
error: 2: expected ';', but found ''
7 errors