From 47d824415e72218a573c821c55207f8561382e71 Mon Sep 17 00:00:00 2001 From: Michael Ludwig Date: Sat, 11 Sep 2021 18:12:28 +0000 Subject: [PATCH] Revert "Fixed DSL assertion error on source files containing nulls" This reverts commit db38ad7b142e44aa4718d7c71d47f680d247cff0. Reason for revert: breaking g3 roll since it thinks the test case is "binary" not flagged as binary Original change's description: > Fixed DSL assertion error on source files containing nulls > > The assertion was there to make sure we weren't running off the end of > the source, but naturally fails in the presence of legitimate embedded > nulls. > > Change-Id: I3b80499e9b182c9ea046c479f35d7a965d548401 > Bug: oss-fuzz:38107 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447182 > Commit-Queue: Ethan Nicholas > Reviewed-by: John Stiles > Reviewed-by: Brian Osman Bug: oss-fuzz:38107 Change-Id: I650d12d728b5d932bda79e81205b873d8b44771f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447936 Bot-Commit: Rubber Stamper Commit-Queue: Michael Ludwig --- gn/sksl_tests.gni | 1 - include/sksl/SkSLErrorReporter.h | 1 + resources/sksl/errors/Ossfuzz38107.sksl | Bin 1 -> 0 bytes tests/sksl/errors/Ossfuzz38107.glsl | 4 ---- 4 files changed, 1 insertion(+), 5 deletions(-) delete mode 100644 resources/sksl/errors/Ossfuzz38107.sksl delete mode 100644 tests/sksl/errors/Ossfuzz38107.glsl diff --git a/gn/sksl_tests.gni b/gn/sksl_tests.gni index 2be77bd47b..77547179f2 100644 --- a/gn/sksl_tests.gni +++ b/gn/sksl_tests.gni @@ -101,7 +101,6 @@ sksl_error_tests = [ "/sksl/errors/Ossfuzz37465.sksl", "/sksl/errors/Ossfuzz37620.sksl", "/sksl/errors/Ossfuzz38106.sksl", - "/sksl/errors/Ossfuzz38107.sksl", "/sksl/errors/Ossfuzz38140.sksl", "/sksl/errors/OverflowFloatLiteral.sksl", "/sksl/errors/OverflowIntLiteral.sksl", diff --git a/include/sksl/SkSLErrorReporter.h b/include/sksl/SkSLErrorReporter.h index 2c90ad854a..1d17f0713c 100644 --- a/include/sksl/SkSLErrorReporter.h +++ b/include/sksl/SkSLErrorReporter.h @@ -53,6 +53,7 @@ public: } fLine = 1; for (int i = 0; i < fOffset; i++) { + SkASSERT(fText[i]); if (fText[i] == '\n') { ++fLine; } diff --git a/resources/sksl/errors/Ossfuzz38107.sksl b/resources/sksl/errors/Ossfuzz38107.sksl deleted file mode 100644 index f76dd238ade08917e6712764a16a22005a50573d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1 IcmZPo000310RR91 diff --git a/tests/sksl/errors/Ossfuzz38107.glsl b/tests/sksl/errors/Ossfuzz38107.glsl deleted file mode 100644 index bc5afa7f21..0000000000 --- a/tests/sksl/errors/Ossfuzz38107.glsl +++ /dev/null @@ -1,4 +0,0 @@ -### Compilation failed: - -error: 1: invalid token -1 error