skia2/tests/sksl/inliner/ExponentialGrowth.sksl
John Stiles 031a76756e Stop the inliner after it has inlined 2500 statements in a program.
This prevents OOMing when given a pathological input, but is large
enough that almost all inputs should continue to compile as-is.

Change-Id: If5c46711b886ee08495bfd09af537e9dc7ea5649
Bug: skia:10945, oss-fuzz:27442
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/334838
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-13 23:02:11 +00:00

27 lines
914 B
Plaintext

/*#pragma settings InlineThresholdMax*/
void fn1() { sk_FragColor.x = 0; }
void fn2() { fn1(); fn1(); fn1(); }
void fn3() { fn2(); fn2(); fn2(); }
void fn4() { fn3(); fn3(); fn3(); }
void fn5() { fn4(); fn4(); fn4(); }
void fn6() { fn5(); fn5(); fn5(); }
void fn7() { fn6(); fn6(); fn6(); }
void fn8() { fn7(); fn7(); fn7(); }
void fn9() { fn8(); fn8(); fn8(); }
void fnA() { fn9(); fn9(); fn9(); }
void fnB() { fnA(); fnA(); fnA(); }
void fnC() { fnB(); fnB(); fnB(); }
void fnD() { fnC(); fnC(); fnC(); }
void fnE() { fnD(); fnD(); fnD(); }
void fnF() { fnE(); fnE(); fnE(); }
void fnG() { fnF(); fnF(); fnF(); }
void fnH() { fnG(); fnG(); fnG(); }
void fnI() { fnH(); fnH(); fnH(); }
void fnJ() { fnI(); fnI(); fnI(); }
void fnK() { fnJ(); fnJ(); fnJ(); }
void fnL() { fnK(); fnK(); fnK(); }
void fnM() { fnL(); fnL(); fnL(); }
void fnN() { fnM(); fnM(); fnM(); }
void main() { fnN(); }