Skip to content

Commit 2eaa148

Browse files
committed
Fix infinite looping when loading a LLVM bitcode module that has llvm.coro.id.retcon.once intrinsics
rdar://149785911
1 parent dbc82b9 commit 2eaa148

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

llvm/lib/IR/AutoUpgrade.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,10 +1139,13 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn,
11391139
}
11401140

11411141
if (F->arg_size() == 6 && Name == "coro.id.retcon.once") {
1142-
rename(F);
1143-
NewFn = Intrinsic::getDeclaration(F->getParent(),
1144-
Intrinsic::coro_id_retcon_once);
1145-
return true;
1142+
auto *FT = F->getFunctionType();
1143+
if (!FT->isVarArg()) {
1144+
rename(F);
1145+
NewFn = Intrinsic::getDeclaration(F->getParent(),
1146+
Intrinsic::coro_id_retcon_once);
1147+
return true;
1148+
}
11461149
}
11471150

11481151
break;

0 commit comments

Comments
 (0)