aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Török <edwintorok@gmail.com>2010-04-02 13:20:51 +0000
committerEdwin Török <edwintorok@gmail.com>2010-04-02 13:20:51 +0000
commit53108421c4660576a2cfc1cbd2ec3c026a582323 (patch)
tree94ecd39dec8cff33990783694fdb59720d3fe99f
parent2d9c308a754ce114260923252f5c23b05fe1dd19 (diff)
downloadexternal_llvm-53108421c4660576a2cfc1cbd2ec3c026a582323.zip
external_llvm-53108421c4660576a2cfc1cbd2ec3c026a582323.tar.gz
external_llvm-53108421c4660576a2cfc1cbd2ec3c026a582323.tar.bz2
Fix SpecificBumpPtrAllocator iteration.
Need to start from (char*)(Slab+1), and not from (char*)Slab+1. This fixes crashes in Win64 debug mode. Thanks to Nicolas Capens! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100184 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/Allocator.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h
index bd38180..eb6c2d1 100644
--- a/include/llvm/Support/Allocator.h
+++ b/include/llvm/Support/Allocator.h
@@ -200,7 +200,7 @@ public:
while (Slab) {
char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
(char *)Slab + Slab->Size;
- for (char *Ptr = (char*)Slab+1; Ptr < End; Ptr += sizeof(T)) {
+ for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
if (Ptr + sizeof(T) <= End)
reinterpret_cast<T*>(Ptr)->~T();