Do not delete the type holder until after the call instruction has been
authorChris Lattner <sabre@nondot.org>
Tue, 23 Dec 2003 20:39:17 +0000 (20:39 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 23 Dec 2003 20:39:17 +0000 (20:39 +0000)
constructed!

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

lib/AsmParser/llvmAsmParser.y

index 8049dc8c6a9c22cc7eeabe5c56a615fd00e61fed..357c9ae0ea835a5a643108a839d6b5c63194e44c 100644 (file)
@@ -1828,7 +1828,6 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
       Ty = FunctionType::get($2->get(), ParamTypes, isVarArg);
       PFTy = PointerType::get(Ty);
     }
-    delete $2;
 
     Value *V = getVal(PFTy, $3);   // Get the function we're calling...
 
@@ -1858,6 +1857,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef {
 
       $$ = new CallInst(V, *$5);
     }
+    delete $2;
     delete $5;
   }
   | MemoryInst {