a695d62772
This addresses a sanitizer issue discovered in https://oss-fuzz.com/testcase-detail/4908118777266176 (it has not been assigned an oss-fuzz bug number yet; coming soon) This puts an upper bound on struct nesting, again to prevent memory- layout and other recursive type-handling code from overflowing the stack. Coincidentally, while researching GLSL behavior around this bug, I learned that WebGL has a similar limitation but caps nested structs to 4 deep. (I could not find any documented GLSL upper bound.) Note that both the GLSL and Metal outputs for StructMaxDepth are badly malformed. (Structs cannot be embedded within another struct in GLSL; structs SA7 and below are never declared in GLSL; the array list for SA7 is backwards in GLSL; Metal is missing structs SA1 through SA8; Metal puts the array list on the type instead of the variable name.) These issues will be addressed in separate CLs. Change-Id: I0f1059b6faa400cd0647dd7010ec839f73779a36 Bug: skia:10922, skia:10923, skia:10925, skia:10926 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333316 Commit-Queue: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com>
23 lines
842 B
Plaintext
23 lines
842 B
Plaintext
struct S1 { int x; };
|
|
struct S2 { S1 x; };
|
|
struct S3 { S2 x; };
|
|
struct S4 { S3 x; };
|
|
struct S5 { S4 x; };
|
|
struct S6 { S5 x; };
|
|
struct S7 { S6 x; };
|
|
struct S8 { S7 x; };
|
|
in S8 s8;
|
|
|
|
// This is the most deeply-nested mix of arrays and structs that we can make with our current
|
|
// limits of eight-deep structs and eight-dimensional arrays. This structure is actually too big to
|
|
// use in SkSL without hitting the maximum parse depth.
|
|
struct SA1 { int x[1][2][3][4][5][6][7][8]; };
|
|
struct SA2 { SA1 x[1][2][3][4][5][6][7][8]; };
|
|
struct SA3 { SA2 x[1][2][3][4][5][6][7][8]; };
|
|
struct SA4 { SA3 x[1][2][3][4][5][6][7][8]; };
|
|
struct SA5 { SA4 x[1][2][3][4][5][6][7][8]; };
|
|
struct SA6 { SA5 x[1][2][3][4][5][6][7][8]; };
|
|
struct SA7 { SA6 x[1][2][3][4][5][6][7][8]; };
|
|
struct SA8 { SA7 x[1][2][3][4][5][6][7][8]; };
|
|
in SA8 sa8[1][2][3][4][5][6][7][8];
|