Fix a cut-and-paste bug for processing of InvokeInst parameter attributes.
authorReid Spencer <rspencer@reidspencer.com>
Sun, 31 Dec 2006 22:17:01 +0000 (22:17 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sun, 31 Dec 2006 22:17:01 +0000 (22:17 +0000)
The lookup of parameter attributes was offset by two because of the
additional operands in an invoke instruction.

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

lib/VMCore/AsmWriter.cpp

index 317eb8e0aac38e8a539a3cdbf36d03950994d8e5..a46adabd1e1f674ecbd269cef5b462a8f9eb35e9 100644 (file)
@@ -1237,8 +1237,8 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
       if (op > 3)
         Out << ',';
       writeOperand(I.getOperand(op), true);
-      if (FTy->getParamAttrs(op) != FunctionType::NoAttributeSet)
-        Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(op));
+      if (FTy->getParamAttrs(op-2) != FunctionType::NoAttributeSet)
+        Out << " " << FTy->getParamAttrsText(FTy->getParamAttrs(op-2));
     }
 
     Out << " )\n\t\t\tto";