Added reportPendingErrors to SkSL code generation

This fixes an assertion failure uncovered by the fuzzer.

Bug: oss-fuzz:37469
Change-Id: I626c003cfa8a0bc65851899df3a7695dbe29200b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441311
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This commit is contained in:
Ethan Nicholas 2021-08-23 15:40:20 -04:00 committed by SkCQ
parent bb447be35a
commit 553239bc12
4 changed files with 7 additions and 0 deletions

View File

@ -188,6 +188,7 @@ sksl_spirv_tests = [
"/sksl/spirv/Ossfuzz35916.sksl",
"/sksl/workarounds/RewriteMatrixVectorMultiply.sksl",
"/sksl/errors/Ossfuzz36850.sksl",
"/sksl/errors/Ossfuzz37469.sksl",
"/sksl/errors/UndefinedFunction.sksl",
"/sksl/errors/UnusedInterfaceBlock.sksl",
]

View File

@ -0,0 +1 @@
k{int z;}m[];void main(){}

View File

@ -3789,6 +3789,7 @@ bool SPIRVCodeGenerator::generateCode() {
this->writeWord(fIdCount, *fOut);
this->writeWord(0, *fOut); // reserved, always zero
write_stringstream(buffer, *fOut);
fContext.fErrors->reportPendingErrors(PositionInfo());
return fContext.fErrors->errorCount() == 0;
}

View File

@ -0,0 +1,4 @@
### Compilation failed:
error: runtime-sized arrays are not supported in SPIR-V
1 error