diff options
author | Torok Edwin <edwintorok@gmail.com> | 2010-04-02 13:20:51 +0000 |
---|---|---|
committer | Torok Edwin <edwintorok@gmail.com> | 2010-04-02 13:20:51 +0000 |
commit | 86bfd34ece523d863282ef2a2e4cf451c387c559 (patch) | |
tree | 94ecd39dec8cff33990783694fdb59720d3fe99f /include | |
parent | 749fd83c04b735de1224d96d481d1d926769d536 (diff) | |
download | external_llvm-86bfd34ece523d863282ef2a2e4cf451c387c559.zip external_llvm-86bfd34ece523d863282ef2a2e4cf451c387c559.tar.gz external_llvm-86bfd34ece523d863282ef2a2e4cf451c387c559.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
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/Allocator.h | 2 |
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(); |