Fix crash in PipelineStageCodeGenerator with recursive calls.

We assumed that any time a function call was emitted, we could look up
the mangled function name in our function-name map and it would exist.
This was not true for self-recursive calls, as the function name is
only added to the map after the function is emitted.

We now use the `functionName()` accessor to retrieve the function name,
which will synthesize a mangled name and add it to the map if it is
missing.

(It looks like recursive calls will not actually work properly, though,
because `writeFunctionPrototype` doesn't emit any code, and the SkVM
compiler can't handle recursion at all.)

Change-Id: I021f5009709d9eed8306eb71cb7f42cbc4c29ae9
Bug: oss-fuzz:36655
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437117
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
1 file changed