Skip to content

Commit da77758

Browse files
committed
[FnSpecialization] If the Argument number is greater than the number of arguments, skip chaining
See test/Transforms/FunctionSpecialization/compiler-crash-60191.ll
1 parent fb21dc6 commit da77758

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Transforms/IPO/FunctionSpecialization.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1067,7 +1067,10 @@ bool FunctionSpecializer::findSpecializations(
10671067
break;
10681068
}
10691069
if (As.size() == Idx) {
1070-
Value *PossC = CS.getArgOperand(A->getArgNo());
1070+
unsigned ArgNo = A->getArgNo();
1071+
if (ArgNo >= CS.arg_size())
1072+
continue;
1073+
Value *PossC = CS.getArgOperand(ArgNo);
10711074
Constant *C = getCandidateConstant(PossC);
10721075
if (!C)
10731076
continue;

0 commit comments

Comments
 (0)