sksl optimizer fixes
authorEthan Nicholas <ethannicholas@google.com>
Fri, 5 May 2017 14:04:06 +0000 (10:04 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 5 May 2017 14:26:38 +0000 (14:26 +0000)
commitc2371a4e325fd123f2d47a9b85d3c8405e8d5e29
treef2055e2a857c400130f4ed2f2b0e35ac9f1064ae
parente12c69e78db3b6451c42e36524ae9e87f75f24fc
sksl optimizer fixes

The main issue was a use-after-free due to removing (and thus destroying)
the binary expression prior to re-adding part of it. Also cleaned up the
way dead assignments are handled and added the test that originally
identified these problems.

Bug: skia:
Change-Id: Icda93d69a66c4e57850ecdc88fc4a4f634e1aac2
Reviewed-on: https://skia-review.googlesource.com/15383
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
src/sksl/SkSLCompiler.cpp
tests/SkSLGLSLTest.cpp