Skip to content

Commit f638f86

Browse files
authored
[FuzzMutate] Prevent the mutator from generating invalid IR caused by non-callable CCs (llvm#139080)
The current implementation can generate invalid IR due to illegal use of CCs. This matches the behaviour of the IRVerifier.
1 parent fbd0565 commit f638f86

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/FuzzMutate/IRMutator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ void InsertFunctionStrategy::mutate(BasicBlock &BB, RandomIRBuilder &IB) {
374374
return T->isMetadataTy() || T->isTokenTy();
375375
};
376376
if (!F || IsUnsupportedTy(F->getReturnType()) ||
377-
any_of(F->getFunctionType()->params(), IsUnsupportedTy)) {
377+
any_of(F->getFunctionType()->params(), IsUnsupportedTy) ||
378+
!isCallableCC(F->getCallingConv())) {
378379
F = IB.createFunctionDeclaration(*M);
379380
}
380381

0 commit comments

Comments
 (0)