summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Allocator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Support/Allocator.cpp b/llvm/lib/Support/Allocator.cpp
index a31b80fcf35..234fd41b738 100644
--- a/llvm/lib/Support/Allocator.cpp
+++ b/llvm/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 {
OpenPOWER on IntegriCloud