diff options
Diffstat (limited to 'src/passes/OptimizeInstructions.cpp')
-rw-r--r-- | src/passes/OptimizeInstructions.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/passes/OptimizeInstructions.cpp b/src/passes/OptimizeInstructions.cpp index 6537e9b56..41f7a9e11 100644 --- a/src/passes/OptimizeInstructions.cpp +++ b/src/passes/OptimizeInstructions.cpp @@ -1566,11 +1566,17 @@ struct OptimizeInstructions if (auto* iff = ref->dynCast<If>()) { if (iff->ifFalse) { if (iff->ifTrue->type.isNull()) { + if (ref->type != iff->ifFalse->type) { + refinalize = true; + } ref = builder.makeSequence(builder.makeDrop(iff->condition), iff->ifFalse); return false; } if (iff->ifFalse->type.isNull()) { + if (ref->type != iff->ifTrue->type) { + refinalize = true; + } ref = builder.makeSequence(builder.makeDrop(iff->condition), iff->ifTrue); return false; |