skia2/resources/sksl/inliner
John Stiles 3ff77f4862 Fix inliner bug discovered by fuzzer.
Intrinsic-call optimization can be triggered during inlining. In this
case, inlining turned `normalize(x)` into `normalize(constant-value)`.

DSL is used to implement optimizations for a handful of intrinsic calls,
including `normalize`, which internally relies on `length`.

The DSL expects that it can use the IRGenerator to handle function
calls. This was not working because we were finished with the initial
compilation pass, and the IRGenerator's symbol table is removed when
finish() was called.

We now temporarily give a symbol table back to the IRGenerator while
the inliner runs. We remove it again as soon as inlining is complete.

Change-Id: I6da98788d93749ffeb008c1f4c3f72b436e8ceeb
Bug: oss-fuzz:37994
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/445956
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-09-07 13:29:37 +00:00
..
DoWhileBodyMustBeInlinedIntoAScope.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
DoWhileTestCannotBeInlined.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ExponentialGrowth.sksl
ForBodyMustBeInlinedIntoAScope.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ForInitializerExpressionsCanBeInlined.sksl Loosen ES3 restrictions in Runtime Effects for debugging. 2021-04-28 19:59:36 +00:00
ForWithoutReturnInsideCanBeInlined.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
ForWithReturnInsideCannotBeInlined.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
IfBodyMustBeInlinedIntoAScope.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
IfElseBodyMustBeInlinedIntoAScope.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
IfElseChainWithReturnsCanBeInlined.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
IfTestCanBeInlined.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
IfWithReturnsCanBeInlined.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlineKeywordOverridesThreshold.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlinerAvoidsVariableNameOverlap.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlinerCanBeDisabled.sksl
InlinerElidesTempVarForReturnsInsideBlock.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlinerHonorsGLSLOutParamSemantics.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlinerManglesNames.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlinerUsesTempVarForMultipleReturns.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlinerUsesTempVarForReturnsInsideBlockWithVar.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlineThreshold.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlineWithInoutArgument.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlineWithModifiedArgument.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlineWithNestedBigCalls.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlineWithNestedCalls.sksl Disallow inlining a function with out-parameters. 2021-03-17 18:04:00 +00:00
InlineWithUnmodifiedArgument.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
InlineWithUnnecessaryBlocks.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
NoInline.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
Ossfuzz37994.sksl Fix inliner bug discovered by fuzzer. 2021-09-07 13:29:37 +00:00
ShortCircuitEvaluationsCannotInlineRightHandSide.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
StaticSwitch.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
StructsCanBeInlinedSafely.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
SwitchWithCastCanBeInlined.sksl
SwitchWithoutReturnInsideCanBeInlined.sksl
SwizzleCanBeInlinedDirectly.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
TernaryResultsCannotBeInlined.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
TernaryTestCanBeInlined.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
TrivialArgumentsInlineDirectly.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
WhileBodyMustBeInlinedIntoAScope.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00
WhileTestCannotBeInlined.sksl Reland "Add coords parameter to all .sksl test files used as runtime effects" 2021-04-27 20:47:31 +00:00