Skip to content

Commit 265524c

Browse files
committed
fix crash with constexpr
1 parent db3b530 commit 265524c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm_util/llvm2alive.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,8 +1542,9 @@ class llvm2alive_ : public llvm::InstVisitor<llvm2alive_, unique_ptr<Instr>> {
15421542

15431543
// patch phi nodes for recursive defs
15441544
for (auto &[phi, i] : todo_phis) {
1545+
insert_constexpr_before = phi;
1546+
BB = const_cast<BasicBlock*>(&Fn.bbOf(*phi));
15451547
for (unsigned idx = 0, e = i->getNumIncomingValues(); idx != e; ++idx) {
1546-
insert_constexpr_before = phi;
15471548
if (auto op = get_operand(i->getIncomingValue(idx))) {
15481549
phi->addValue(*op, value_name(*i->getIncomingBlock(idx)));
15491550
} else {

0 commit comments

Comments
 (0)