Re-land of skslc switch support
This reverts commit 7d975fc200bbbea991ec4c04c08f3a5ea7b847af.
BUG=skia:
Change-Id: I57521f7a291a35cfed58d623ea4f8da29582d2c5
Reviewed-on: https://skia-review.googlesource.com/8993
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 004eab7..d574239 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -286,8 +286,12 @@
if (e1 != e2) {
// definition has changed, merge and add exit block to worklist
workList->insert(exitId);
- exit.fBefore[pair.first] =
+ if (e1 && e2) {
+ exit.fBefore[pair.first] =
(std::unique_ptr<Expression>*) &fContext.fDefined_Expression;
+ } else {
+ exit.fBefore[pair.first] = nullptr;
+ }
}
}
}