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 | 3645e95c913a7e46fbea2c603b2db4ae479a69da (patch) | |
tree | e4794d69375242a4cfbc402e2f9db87eef41a5f9 | |
parent | 92452b9e127ae816e33e0586e0657030e919d3bf (diff) | |
download | bcm5719-llvm-3645e95c913a7e46fbea2c603b2db4ae479a69da.tar.gz bcm5719-llvm-3645e95c913a7e46fbea2c603b2db4ae479a69da.zip |
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!
llvm-svn: 100184
-rw-r--r-- | llvm/include/llvm/Support/Allocator.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h index bd381807e0c..eb6c2d1e25a 100644 --- a/llvm/include/llvm/Support/Allocator.h +++ b/llvm/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(); |