[llvm-commits] [poolalloc] r75184 - /poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp

Haohui Mai mai4 at uiuc.edu
Thu Jul 9 15:31:11 PDT 2009


Author: mai4
Date: Thu Jul  9 17:31:11 2009
New Revision: 75184

URL: http://llvm.org/viewvc/llvm-project?rev=75184&view=rev
Log:
Use the correct pointer when pool allocating poolfree().


Modified:
    poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp

Modified: poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp?rev=75184&r1=75183&r2=75184&view=diff

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PAMultipleGlobalPool.cpp Thu Jul  9 17:31:11 2009
@@ -284,8 +284,9 @@
       } else if (FreeInst * FI = dyn_cast<FreeInst>(ii)) {
         Type * VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
         Value * FreedNode = castTo (FI->getPointerOperand(), VoidPtrTy, "cast", ii);
-        DSNode * Node = ECG->getNodeForValue(FreedNode).getNode();
+        DSNode * Node = ECG->getNodeForValue(FI->getPointerOperand()).getNode();
         GlobalVariable * Pool = PoolMap[Node];
+        assert (Pool && "No Pool Handle for poolfree()!");
         toDelete.push_back(ii);
         Value* args[] = {Pool, FreedNode};
         CallInst::Create(PoolFree, &args[0], &args[2], "", ii);





More information about the llvm-commits mailing list