summaryrefslogtreecommitdiff
path: root/src/passes/Outlining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/Outlining.cpp')
-rw-r--r--src/passes/Outlining.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/passes/Outlining.cpp b/src/passes/Outlining.cpp
index c7644c339..f799d2c7a 100644
--- a/src/passes/Outlining.cpp
+++ b/src/passes/Outlining.cpp
@@ -93,6 +93,11 @@ struct ReconstructStringifyWalker
ASSERT_OK(existingBuilder.visitBlockStart(curr->block));
DBG(desc = "Block Start for ");
} else if (auto curr = reason.getIfStart()) {
+ // IR builder needs the condition of the If pushed onto the builder before
+ // visitIfStart(), which will expect to be able to pop the condition.
+ // This is always okay to do because the correct condition was installed
+ // onto the If when the outer scope was visited.
+ existingBuilder.push(curr->iff->condition);
ASSERT_OK(existingBuilder.visitIfStart(curr->iff));
DBG(desc = "If Start for ");
} else if (reason.getEnd()) {