80b02af6ba
Multi-dimensional arrays aren't legal in GLSL/SkSL, so this should be caught and flagged as an error. The parser now verifies that a variable's type isn't an array-type before accepting a `[` token to open an array on the variable name. This CL also refactors the IR generator's `convertArraySize` method to make sure that various checks are made for all callers. Originally this restructuring was used to verify array multi-dimensionality, but that didn't detect errors inside struct declarations (which get no error checking inside the IR generator) so the IR generator updates no longer need to check the array dimensions. Bug: skia:11322 Change-Id: Id33f4bdfb544019ddf995a8196c3c09cfe5a4525 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/369916 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: John Stiles <johnstiles@google.com>
11 lines
168 B
Plaintext
11 lines
168 B
Plaintext
// Expect 7 errors
|
|
|
|
void a[2];
|
|
void[2] b;
|
|
|
|
void funcD(void d[2]) {}
|
|
void funcE(void[2] e) {}
|
|
void[2] funcF() {}
|
|
void funcG() { void g[2]; }
|
|
void funcH() { void[2] h; }
|