mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 975182 - OdinMonkey: when triggering operation callback, leave PROT_READ|PROT_WRITE (r=benj)
This commit is contained in:
parent
4eed36705e
commit
9bb539a959
18
js/src/jit-test/tests/asm.js/testBug975182.js
Normal file
18
js/src/jit-test/tests/asm.js/testBug975182.js
Normal file
@ -0,0 +1,18 @@
|
||||
Function("\
|
||||
g = (function(t,foreign){\
|
||||
\"use asm\";\
|
||||
var ff = foreign.ff;\
|
||||
function f() {\
|
||||
+ff()\
|
||||
}\
|
||||
return f\
|
||||
})(this, {\
|
||||
ff: arguments.callee\
|
||||
}, ArrayBuffer(4096))\
|
||||
")()
|
||||
function m(f) {
|
||||
for (var j = 0; j < 6000; ++j) {
|
||||
f();
|
||||
}
|
||||
}
|
||||
m(g);
|
@ -1031,10 +1031,10 @@ js::TriggerOperationCallbackForAsmJSCode(JSRuntime *rt)
|
||||
|
||||
#if defined(XP_WIN)
|
||||
DWORD oldProtect;
|
||||
if (!VirtualProtect(module.codeBase(), module.functionBytes(), PAGE_NOACCESS, &oldProtect))
|
||||
if (!VirtualProtect(module.codeBase(), module.functionBytes(), PAGE_READWRITE, &oldProtect))
|
||||
MOZ_CRASH();
|
||||
#else // assume Unix
|
||||
if (mprotect(module.codeBase(), module.functionBytes(), PROT_NONE))
|
||||
if (mprotect(module.codeBase(), module.functionBytes(), PROT_READ|PROT_WRITE))
|
||||
MOZ_CRASH();
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user