1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:17:44 +00:00

UserspaceEmulator: Don't set the MmapRegion malloc-block bit too early

We were setting it before the malloc metadata had been instantiated.

Fixes #5707.
This commit is contained in:
Andreas Kling 2021-03-09 13:57:17 +01:00
parent 1381720d1d
commit 57142a29a0

View file

@ -64,9 +64,6 @@ void MallocTracer::target_did_malloc(Badge<Emulator>, FlatPtr address, size_t si
VERIFY(is<MmapRegion>(*region));
auto& mmap_region = static_cast<MmapRegion&>(*region);
// Mark the containing mmap region as a malloc block!
mmap_region.set_malloc(true);
auto* shadow_bits = mmap_region.shadow_data() + address - mmap_region.base();
memset(shadow_bits, 0, size);