Skip to content

Commit aa737f3

Browse files
committed
fix leftover crash in phi handling after constexpr changes
1 parent 3b50883 commit aa737f3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm_util/llvm2alive.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ class llvm2alive_ : public llvm::InstVisitor<llvm2alive_, unique_ptr<Instr>> {
146146
"%__copy_" + to_string(copy_idx++), *ag,
147147
UnaryOp::Copy);
148148
auto val = v.get();
149-
BB->addInstr(std::move(v));
149+
if (insert_constexpr_before)
150+
BB->addInstrAt(std::move(v), insert_constexpr_before, true);
151+
else
152+
BB->addInstr(std::move(v));
150153
return val;
151154
}
152155

0 commit comments

Comments
 (0)