aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-23 22:31:24 +0000
committerChris Lattner <sabre@nondot.org>2007-02-23 22:31:24 +0000
commitd675b8347dd5f10496aa331811eed8d5e066f70d (patch)
tree7901c76b54f5751843f7bee23b4073a8c332ea88 /lib
parentda10e3350a6a63d5008f09cc4bf7d8e3ccbd6d60 (diff)
downloadexternal_llvm-d675b8347dd5f10496aa331811eed8d5e066f70d.zip
external_llvm-d675b8347dd5f10496aa331811eed8d5e066f70d.tar.gz
external_llvm-d675b8347dd5f10496aa331811eed8d5e066f70d.tar.bz2
Avoid TBAA issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34539 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/Allocator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Support/Allocator.cpp b/lib/Support/Allocator.cpp
index a31b80f..234fd41 100644
--- a/lib/Support/Allocator.cpp
+++ b/lib/Support/Allocator.cpp
@@ -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 {