mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-09 10:31:14 +00:00
Avoid zero length memset error
Adding a check on buffer lenght to avoid a __warn_memset_zero_len warning on GCC 4.8.2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216624 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a160df5b42
commit
96c845a36c
@ -318,8 +318,10 @@ private:
|
||||
#ifndef NDEBUG
|
||||
// Poison the memory so stale pointers crash sooner. Note we must
|
||||
// preserve the Size and NextPtr fields at the beginning.
|
||||
sys::Memory::setRangeWritable(*I, AllocatedSlabSize);
|
||||
memset(*I, 0xCD, AllocatedSlabSize);
|
||||
if (AllocatedSlabSize != 0) {
|
||||
sys::Memory::setRangeWritable(*I, AllocatedSlabSize);
|
||||
memset(*I, 0xCD, AllocatedSlabSize);
|
||||
}
|
||||
#endif
|
||||
Allocator.Deallocate(*I, AllocatedSlabSize);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user