Fixed a few spots where SkSL optimizer was not respecting side effects

This was affecting expressions such as 0 * float4(<expr>), which would
be collapsed down to float4(0) - in some cases even if <expr> had side
effects. This is obviously incorrect no matter what, but to make matters
worse it could lead to a use-after-free when we eliminated an assignment
which we were tracking as the current definition of a variable.

Bug: skia:7467
Change-Id: I91ba154c57dad9cadf36b6062bec3211557248e0
Reviewed-on: https://skia-review.googlesource.com/98704
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
1 file changed