skia2/resources/sksl/errors/ArrayOfInvalidSize.sksl
John Stiles 7253a201a3 Improve error-checking during array-size conversion.
The fuzzer noticed insufficient guards in IndexExpression::Convert when
converting an array size from an IntLiteral to a SKSL_INT. We had code
in IRGenerator which did this properly, so I moved our array-size
conversion logic into SkSLType and had IndexExpression share it.

Also, a variety of tests around similar error conditions were added.

Change-Id: I51529dea25f9029f81ae236511610069d66be29f
Bug: oss-fuzz:37462
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441236
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-08-23 14:35:00 +00:00

19 lines
488 B
Plaintext

void a() { float[-2]; }
void b() { float[-1]; }
void c() { float[0]; }
void d() { float[1.5]; }
void e() { float[4000000000]; }
void f() { float[true]; }
void g() { float[false]; }
void h() { float[int2(2, 2)]; }
void i() { float[]; }
void j() { float x[-2]; }
void k() { float x[-1]; }
void l() { float x[0]; }
void m() { float x[1.5]; }
void n() { float x[4000000000]; }
void o() { float x[true]; }
void p() { float x[false]; }
void q() { float x[int2(2, 2)]; }
void r() { float x[]; }