Fixed crash caused by failure to allocate memory block of very special size

Allocation of 810 FState objects (32400 bytes in total) could be performed in MSVC x64 build but worked in 32-bit version
This fixes https://mantis.zdoom.org/view.php?id=602
This commit is contained in:
alexey.lysiuk 2017-04-19 17:52:43 +03:00
parent 29402ff685
commit 403634c0e1

View file

@ -255,7 +255,7 @@ FMemArena::Block *FMemArena::AddBlock(size_t size)
void FMemArena::Block::Reset() void FMemArena::Block::Reset()
{ {
Avail = RoundPointer(this + sizeof(*this)); Avail = RoundPointer(reinterpret_cast<char*>(this) + sizeof(*this));
} }
//========================================================================== //==========================================================================