Fix an assumption that there is a single return value when verifying
authorBob Wilson <bob.wilson@apple.com>
Wed, 29 Jul 2009 16:25:56 +0000 (16:25 +0000)
committerBob Wilson <bob.wilson@apple.com>
Wed, 29 Jul 2009 16:25:56 +0000 (16:25 +0000)
overloaded types for intrinsic parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77466 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp

index 06bc9e72b4080dbc941a8a671d34beca33ec5916..6d179d01a6b432e6b4885bc60ac184bf8d78b8cb 100644 (file)
@@ -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;
       }
     }