[FastISel] Fix a bug in FastISel::CallLoweringInfo.
authorJuergen Ributzka <juergen@apple.com>
Mon, 15 Sep 2014 22:07:44 +0000 (22:07 +0000)
committerJuergen Ributzka <juergen@apple.com>
Mon, 15 Sep 2014 22:07:44 +0000 (22:07 +0000)
This fixes a bug in FastISel::CallLoweringInfo, where the number of
arguments was obtained from the argument vector before it had been
initialized.

Test case follows in another commit.

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

include/llvm/CodeGen/FastISel.h

index 9fc3a8751253f091ecfa07bcfad9693fa3e3c4be..80b3a40017dabb06601874f0126e503550ef50f3 100644 (file)
@@ -103,8 +103,8 @@ public:
       RetZExt = Call.paramHasAttr(0, Attribute::ZExt);
 
       CallConv = Call.getCallingConv();
-      NumFixedArgs = FuncTy->getNumParams();
       Args = std::move(ArgsList);
+      NumFixedArgs = FuncTy->getNumParams();
 
       CS = &Call;
 
@@ -127,8 +127,8 @@ public:
       RetZExt = Call.paramHasAttr(0, Attribute::ZExt);
 
       CallConv = Call.getCallingConv();
-      NumFixedArgs = (FixedArgs == ~0U) ? FuncTy->getNumParams() : FixedArgs;
       Args = std::move(ArgsList);
+      NumFixedArgs = (FixedArgs == ~0U) ? FuncTy->getNumParams() : FixedArgs;
 
       CS = &Call;