fix crash when going through an unsupport llvm constexpr in phi
MODIFY
llvm_util/llvm2alive.cpp
llvm_util/llvm2alive.cpp
@@ -1490,12 +1490,14 @@ public:
= value_name(*i->getIncomingBlock(idx)) + "_" + phi_bb.getName();
BB = &Fn.insertBBBefore(bridge, phi_bb);
getBB(i->getIncomingBlock(idx)).replaceTargetWith(&phi_bb, BB);
- auto op = get_operand(val);
- assert(op);
+ if (auto op = get_operand(val)) {
phi->addValue(*op, move(bridge));
BB->addInstr(make_unique<Branch>(phi_bb));
continue;
}
+ error(*i);
+ return {};
+ }
if (auto op = get_operand(val)) {
phi->addValue(*op, value_name(*i->getIncomingBlock(idx)));

fix crash when going through an unsupport llvm constexpr in phi