skia2/tests/sksl/errors/OverflowUintLiteral.glsl
John Stiles 378e4aecfe Report int-literal overflow via cast-from-float.
The fuzzer discovered that SkSL could create an out-of-range int literal
by casting from a floating point literal. We were only doing range
checks when the starting literal was an integer. Since we now assert
when an out-of-range int literal is created (as of
http://review.skia.org/464124), the fuzzer can detect this error.

Change-Id: Ie66f60ddbe7b4fbe5b648c17292c59a4ba079716
Bug: oss-fuzz:40456
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/465385
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-10-29 14:55:30 +00:00

10 lines
369 B
GLSL

### Compilation failed:
error: 4: integer is out of range for type 'uint': -1
error: 6: integer is too large: 4294967296
error: 8: integer is out of range for type 'ushort': -1
error: 9: integer is out of range for type 'ushort': 65536
error: 11: integer is out of range for type 'uint': 4294967296
error: 12: integer is out of range for type 'ushort': 65536
6 errors