зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1235201 - Make W^X work in Win64 browser builds. r=luke
This commit is contained in:
Родитель
fe24a17559
Коммит
d0979f07b0
|
@ -126,6 +126,10 @@ ExceptionHandler(PEXCEPTION_RECORD exceptionRecord, _EXCEPTION_REGISTRATION_RECO
|
|||
static bool
|
||||
RegisterExecutableMemory(void* p, size_t bytes, size_t pageSize)
|
||||
{
|
||||
DWORD oldProtect;
|
||||
if (!VirtualProtect(p, pageSize, PAGE_READWRITE, &oldProtect))
|
||||
return false;
|
||||
|
||||
ExceptionHandlerRecord* r = reinterpret_cast<ExceptionHandlerRecord*>(p);
|
||||
|
||||
// All these fields are specified to be offsets from the base of the
|
||||
|
@ -158,7 +162,6 @@ RegisterExecutableMemory(void* p, size_t bytes, size_t pageSize)
|
|||
r->thunk[10] = 0xff;
|
||||
r->thunk[11] = 0xe0;
|
||||
|
||||
DWORD oldProtect;
|
||||
if (!VirtualProtect(p, pageSize, PAGE_EXECUTE_READ, &oldProtect))
|
||||
return false;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче