[llvm-commits] [poolalloc] r158326 - /poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
Matthew Wala
mttjwl at gmail.com
Mon Jun 11 13:48:51 PDT 2012
Author: wala1
Date: Mon Jun 11 15:48:51 2012
New Revision: 158326
URL: http://llvm.org/viewvc/llvm-project?rev=158326&view=rev
Log:
The freed pointer should be at operand 0 of the CallInst.
Modified:
poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
Modified: poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PASimple.cpp?rev=158326&r1=158325&r2=158326&view=diff
==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Mon Jun 11 15:48:51 2012
@@ -489,7 +489,7 @@
CI->replaceAllUsesWith(Casted);
} else if (CF && (CF->isDeclaration()) && ((CF->getName() == "free") || (CF->getName() == "cfree"))) {
Type * VoidPtrTy = PointerType::getUnqual(Int8Type);
- Value * FreedNode = castTo (CI->getOperand(1), VoidPtrTy, "cast", ii);
+ Value * FreedNode = castTo (CI->getOperand(0), VoidPtrTy, "cast", ii);
toDelete.push_back(ii);
Value* args[] = {TheGlobalPool, FreedNode};
CallInst::Create(PoolFree, args, "", ii);
More information about the llvm-commits
mailing list