mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-04 17:58:22 +00:00
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
This commit is contained in:
parent
749fd83c04
commit
86bfd34ece
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user