[llvm-commits] [poolalloc] r124913 - /poolalloc/trunk/lib/DSA/Local.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Fri Feb 4 16:31:57 PST 2011


Author: aggarwa4
Date: Fri Feb  4 18:31:56 2011
New Revision: 124913

URL: http://llvm.org/viewvc/llvm-project?rev=124913&view=rev
Log:
Make sure we increment the size correctly.

Modified:
    poolalloc/trunk/lib/DSA/Local.cpp

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=124913&r1=124912&r2=124913&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Fri Feb  4 18:31:56 2011
@@ -512,8 +512,8 @@
         if(GEPInst->getType() == llvm::Type::getInt8PtrTy(GEPInst->getParent()->getParent()->getContext()))
           if(GEPInst->getNumIndices() == 1) {
             Offset = (cast<ConstantInt>(GEPInst->getOperand(1)))->getSExtValue();
-            if(Value.getNode()->getSize() <= (Offset+1)) {
-              Value.getNode()->growSize(Offset + 1);
+            if(Value.getNode()->getSize() <= Value.getOffset() + (Offset+1)) {
+              Value.getNode()->growSize(Value.getOffset() + Offset + 1);
             }
             Value.setOffset(Value.getOffset()+Offset);
             DSNode *N = Value.getNode();





More information about the llvm-commits mailing list