diff options
| author | Reid Kleckner <reid@kleckner.net> | 2009-07-25 21:26:02 +0000 | 
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2009-07-25 21:26:02 +0000 | 
| commit | 4b1f2f4779142e996b321b1e0435629ca37de7fd (patch) | |
| tree | 01d56a429c02e1fea45c3dcb852f4c44a940fd35 /llvm/lib | |
| parent | dedf1e4b1ab988a12e734b27bd6b60ba11ce054a (diff) | |
| download | bcm5719-llvm-4b1f2f4779142e996b321b1e0435629ca37de7fd.tar.gz bcm5719-llvm-4b1f2f4779142e996b321b1e0435629ca37de7fd.zip  | |
Added a test and fixed a bug in BumpPtrAllocator relating to large alignment
values.  Hopefully this fixes PR4622.
llvm-svn: 77088
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Support/Allocator.cpp | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Support/Allocator.cpp b/llvm/lib/Support/Allocator.cpp index 230c421f1fe..36da4432073 100644 --- a/llvm/lib/Support/Allocator.cpp +++ b/llvm/lib/Support/Allocator.cpp @@ -95,8 +95,8 @@ void *BumpPtrAllocator::Allocate(size_t Size, size_t Alignment) {    }    // If Size is really big, allocate a separate slab for it. -  if (Size > SizeThreshold) { -    size_t PaddedSize = Size + sizeof(MemSlab) + Alignment - 1; +  size_t PaddedSize = Size + sizeof(MemSlab) + Alignment - 1; +  if (PaddedSize > SizeThreshold) {      MemSlab *NewSlab = Allocator.Allocate(PaddedSize);      // Put the new slab after the current slab, since we are not allocating  | 

