diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 06bc9e72b40..6d179d01a6b 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1544,9 +1544,9 @@ bool Verifier::PerformTypeCheck(Intrinsic::ID ID, Function *F, const Type *Ty, return false; } } else { - if (Ty != FTy->getParamType(Match - 1)) { + if (Ty != FTy->getParamType(Match - NumRets)) { CheckFailed(IntrinsicParam(ArgNo, NumRets) + " does not " - "match parameter %" + utostr(Match - 1) + ".", F); + "match parameter %" + utostr(Match - NumRets) + ".", F); return false; } }