From e0a33e28e2786fb17be2edf28e04cd62bfe4ec1e Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Wed, 21 Jun 2017 21:25:26 +0000 Subject: Revert "clean up sksl dead variable handling" This reverts commit b29dd819c9f4cc0f33c24a10b128c363a4c83a6f. Reason for revert: asan errors Original change's description: > clean up sksl dead variable handling > > Change-Id: I301e82bf87d976e59a02b0f383da67eaf5a8795a > Reviewed-on: https://skia-review.googlesource.com/18494 > Reviewed-by: Chris Dalton > Commit-Queue: Ethan Nicholas TBR=csmartdalton@google.com,ethannicholas@google.com Change-Id: I32b3c6a04a014b31360d92b3f85491b01e8a381c No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/20480 Reviewed-by: Greg Daniel Commit-Queue: Greg Daniel --- src/sksl/SkSLGLSLCodeGenerator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/sksl/SkSLGLSLCodeGenerator.cpp') diff --git a/src/sksl/SkSLGLSLCodeGenerator.cpp b/src/sksl/SkSLGLSLCodeGenerator.cpp index 4326f4c794..6381acb322 100644 --- a/src/sksl/SkSLGLSLCodeGenerator.cpp +++ b/src/sksl/SkSLGLSLCodeGenerator.cpp @@ -621,6 +621,9 @@ void GLSLCodeGenerator::writeVarDeclarations(const VarDeclarations& decl, bool g ASSERT(decl.fVars.size() > 0); bool wroteType = false; for (const auto& stmt : decl.fVars) { + if (stmt->fKind == Statement::kNop_Kind) { + continue; + } VarDeclaration& var = (VarDeclaration&) *stmt; if (wroteType) { this->write(", "); @@ -835,7 +838,6 @@ bool GLSLCodeGenerator::generateCode() { case ProgramElement::kVar_Kind: { VarDeclarations& decl = (VarDeclarations&) *e; if (decl.fVars.size() > 0) { - ASSERT(decl.fVars[0]->fKind == Statement::kVarDeclaration_Kind); int builtin = ((VarDeclaration&) *decl.fVars[0]).fVar->fModifiers.fLayout.fBuiltin; if (builtin == -1) { -- cgit v1.2.3