OSDN Git Service

Avoid TBAA issue.
authorChris Lattner <sabre@nondot.org>
Fri, 23 Feb 2007 22:31:24 +0000 (22:31 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 23 Feb 2007 22:31:24 +0000 (22:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34539 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Allocator.cpp

index a31b80f..234fd41 100644 (file)
@@ -93,7 +93,10 @@ BumpPtrAllocator::~BumpPtrAllocator() {
 }
 
 void *BumpPtrAllocator::Allocate(unsigned Size, unsigned Align) {
-  return ((MemRegion*)TheMemory)->Allocate(Size, Align,(MemRegion**)&TheMemory);
+  MemRegion *MRP = (MemRegion*)TheMemory;
+  void *Ptr = MRP->Allocate(Size, Align, &MRP);
+  TheMemory = MRP;
+  return Ptr;
 }
 
 void BumpPtrAllocator::PrintStats() const {