Bug 864872 - OdinMonkey: protect all the code pages on Windows (r=sstangl)
authorLuke Wagner <luke@mozilla.com>
Tue, 23 Apr 2013 14:03:45 -0700
changeset 140630 649497c7a2e97d8b6733135cd1b3191ef23ee65b
parent 140629 789256edc44a126976dbf93e855772df81b42d63
child 140631 c62f4690d4d3f4dbacd0145bc3f0fc213f7b6f2f
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl
bugs864872
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 864872 - OdinMonkey: protect all the code pages on Windows (r=sstangl)
js/src/ion/AsmJSSignalHandlers.cpp
--- a/js/src/ion/AsmJSSignalHandlers.cpp
+++ b/js/src/ion/AsmJSSignalHandlers.cpp
@@ -944,16 +944,16 @@ js::TriggerOperationCallbackForAsmJSCode
     AsmJSActivation *activation = rt->mainThread.asmJSActivationStackFromAnyThread();
     if (!activation)
         return;
 
     const AsmJSModule &module = activation->module();
 
 # if defined(XP_WIN)
     DWORD oldProtect;
-    if (!VirtualProtect(module.functionCode(), 4096, PAGE_NOACCESS, &oldProtect))
+    if (!VirtualProtect(module.functionCode(), module.functionBytes(), PAGE_NOACCESS, &oldProtect))
         MOZ_CRASH();
 # else  // assume Unix
     if (mprotect(module.functionCode(), module.functionBytes(), PROT_NONE))
         MOZ_CRASH();
 # endif
 #endif
 }