mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1250190: Make DebuggeeWouldRun checks not assume we always unlock before re-locking. r=fitzgen
This commit is contained in:
parent
ece21d9ce8
commit
82079be7a5
@ -13,6 +13,8 @@ basic/testBug614653.js
|
||||
basic/testBug686274.js
|
||||
basic/testManyVars.js
|
||||
basic/testTypedArrayInit.js
|
||||
debug/DebuggeeWouldRun-01.js
|
||||
debug/DebuggeeWouldRun-02.js
|
||||
gc/bug-1014972.js
|
||||
gc/bug-1246593.js
|
||||
gc/bug-906236.js
|
||||
|
7
js/src/jit-test/tests/debug/DebuggeeWouldRun-01.js
Normal file
7
js/src/jit-test/tests/debug/DebuggeeWouldRun-01.js
Normal file
@ -0,0 +1,7 @@
|
||||
// Bug 1250190: Shouldn't crash. |jit-test| exitstatus: 3
|
||||
|
||||
g = newGlobal();
|
||||
var dbg = Debugger(g)
|
||||
dbg.onNewPromise = () => g.makeFakePromise();
|
||||
g.makeFakePromise();
|
||||
|
7
js/src/jit-test/tests/debug/DebuggeeWouldRun-02.js
Normal file
7
js/src/jit-test/tests/debug/DebuggeeWouldRun-02.js
Normal file
@ -0,0 +1,7 @@
|
||||
// Bug 1250190: Shouldn't crash. |jit-test| exitstatus: 3
|
||||
|
||||
var g = newGlobal();
|
||||
var dbg = Debugger(g)
|
||||
dbg.onNewGlobalObject = () => g.newGlobal();
|
||||
g.newGlobal();
|
||||
print("yo");
|
9
js/src/jit-test/tests/debug/DebuggeeWouldRun-03.js
Normal file
9
js/src/jit-test/tests/debug/DebuggeeWouldRun-03.js
Normal file
@ -0,0 +1,9 @@
|
||||
// Bug 1250190: Shouldn't crash. |jit-test| error: yadda
|
||||
|
||||
var g = newGlobal();
|
||||
var dbg = new Debugger(g);
|
||||
dbg.onNewGlobalObject = function () {
|
||||
dbg.onNewGlobalObject = function () { throw "yadda"; };
|
||||
newGlobal();
|
||||
}
|
||||
newGlobal();
|
9
js/src/jit-test/tests/debug/DebuggeeWouldRun-04.js
Normal file
9
js/src/jit-test/tests/debug/DebuggeeWouldRun-04.js
Normal file
@ -0,0 +1,9 @@
|
||||
// Bug 1250190: Shouldn't crash. |jit-test| error: yadda
|
||||
|
||||
var g = newGlobal();
|
||||
var dbg = new Debugger(g);
|
||||
dbg.onNewScript = function () {
|
||||
dbg.onNewScript = function () { throw "yadda"; };
|
||||
g.Function("noodles;");
|
||||
}
|
||||
g.Function("poodles;");
|
@ -311,18 +311,13 @@ class MOZ_RAII js::EnterDebuggeeNoExecute
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
static bool isUniqueLockedInStack(JSContext* cx, Debugger& dbg) {
|
||||
static bool isLockedInStack(JSContext* cx, Debugger& dbg) {
|
||||
JSRuntime* rt = cx->runtime();
|
||||
EnterDebuggeeNoExecute* found = nullptr;
|
||||
for (EnterDebuggeeNoExecute* it = rt->noExecuteDebuggerTop; it; it = it->prev_) {
|
||||
if (&it->debugger() == &dbg && !it->unlocked_) {
|
||||
// This invariant does not hold when DebuggeeWouldRun is only a
|
||||
// warning.
|
||||
MOZ_ASSERT_IF(rt->options().throwOnDebuggeeWouldRun(), !found);
|
||||
found = it;
|
||||
}
|
||||
if (&it->debugger() == &dbg)
|
||||
return !it->unlocked_;
|
||||
}
|
||||
return !!found;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1155,7 +1150,7 @@ Debugger::handleUncaughtExceptionHelper(Maybe<AutoCompartment>& ac,
|
||||
|
||||
// Uncaught exceptions arise from Debugger code, and so we must already be
|
||||
// in an NX section.
|
||||
MOZ_ASSERT(EnterDebuggeeNoExecute::isUniqueLockedInStack(cx, *this));
|
||||
MOZ_ASSERT(EnterDebuggeeNoExecute::isLockedInStack(cx, *this));
|
||||
|
||||
if (cx->isExceptionPending()) {
|
||||
if (callHook && uncaughtExceptionHook) {
|
||||
|
Loading…
Reference in New Issue
Block a user