зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1250190: Make DebuggeeWouldRun checks not assume we always unlock before re-locking. r=fitzgen
--HG-- extra : rebase_source : 3d14ae5bfff214fca7edd9c5d5870ce11a686b3f
This commit is contained in:
Родитель
1aba8160bb
Коммит
159d69538f
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
@ -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");
|
|
@ -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();
|
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче