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>
2 files changed