mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 926778 - Prevent executable allocator from handing out poisoned pointers with JSGC_ROOT_ANALYSIS, r=terrence
This commit is contained in:
parent
243fdceb01
commit
a59449cc10
@ -32,6 +32,7 @@
|
||||
|
||||
#include "assembler/wtf/Assertions.h"
|
||||
#include "assembler/wtf/VMTags.h"
|
||||
#include "js/Utility.h"
|
||||
|
||||
namespace JSC {
|
||||
|
||||
@ -42,7 +43,14 @@ size_t ExecutableAllocator::determinePageSize()
|
||||
|
||||
ExecutablePool::Allocation ExecutableAllocator::systemAlloc(size_t n)
|
||||
{
|
||||
void* allocation = mmap(NULL, n, INITIAL_PROTECTION_FLAGS, MAP_PRIVATE | MAP_ANON, VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY, 0);
|
||||
void* allocation;
|
||||
#ifdef JSGC_ROOT_ANALYSIS
|
||||
do {
|
||||
#endif
|
||||
allocation = mmap(NULL, n, INITIAL_PROTECTION_FLAGS, MAP_PRIVATE | MAP_ANON, VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY, 0);
|
||||
#ifdef JSGC_ROOT_ANALYSIS
|
||||
} while (allocation && JS::IsPoisonedPtr(allocation));
|
||||
#endif
|
||||
if (allocation == MAP_FAILED)
|
||||
allocation = NULL;
|
||||
ExecutablePool::Allocation alloc = { reinterpret_cast<char*>(allocation), n };
|
||||
|
Loading…
Reference in New Issue
Block a user