summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2011-04-08 07:54:50 -1000
committerEric Anholt <eric@anholt.net>2011-04-13 10:51:03 -0700
commit909bd476ca65035b93399c7b95f7118b1cded3f2 (patch)
treedbd48bd0e58622e01d4c0b0716ecbc8a6accae1f
parent487debfda56ad3855db655688186401b0dd75233 (diff)
glsl/opt_cpe: Fix a crash when a kill kills for two reasons.
Fixes glsl-copy-propagation-loop-2 when this optimization pass is re-enabled. Reported-by: David Lamparter <equinox@diac24.net>
-rw-r--r--src/glsl/opt_copy_propagation_elements.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/opt_copy_propagation_elements.cpp b/src/glsl/opt_copy_propagation_elements.cpp
index 1ffbd4da144..a91e624cb72 100644
--- a/src/glsl/opt_copy_propagation_elements.cpp
+++ b/src/glsl/opt_copy_propagation_elements.cpp
@@ -390,8 +390,10 @@ ir_copy_propagation_elements_visitor::kill(kill_entry *k)
if (entry->lhs == k->var) {
entry->write_mask = entry->write_mask & ~k->write_mask;
- if (entry->write_mask == 0)
+ if (entry->write_mask == 0) {
entry->remove();
+ continue;
+ }
}
if (entry->rhs == k->var) {
entry->remove();