mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Bug 1331064 - Ignore wasm onExceptionUnwind events in JSTRAP_ERROR state. r=luke
MozReview-Commit-ID: BU8YzfFLqc1 --HG-- extra : rebase_source : 33349153d605ecfc8a6e08ae2066b80ca28c4681
This commit is contained in:
parent
384e926e5e
commit
c7ae107dc6
22
js/src/jit-test/tests/debug/bug1331064.js
Normal file
22
js/src/jit-test/tests/debug/bug1331064.js
Normal file
@ -0,0 +1,22 @@
|
||||
// |jit-test| test-also-wasm-baseline; exitstatus: 3
|
||||
|
||||
load(libdir + "asserts.js");
|
||||
|
||||
if (!wasmIsSupported())
|
||||
quit(3);
|
||||
|
||||
var g = newGlobal();
|
||||
g.parent = this;
|
||||
g.eval("new Debugger(parent).onExceptionUnwind = function () { some_error; };");
|
||||
|
||||
var module = new WebAssembly.Module(wasmTextToBinary(`
|
||||
(module
|
||||
(import $imp "a" "b" (result i32))
|
||||
(func $call (result i32) (call 0))
|
||||
(export "call" $call)
|
||||
)`));
|
||||
|
||||
var instance = new WebAssembly.Instance(module, { a: { b: () => {
|
||||
some_other_error;
|
||||
}}});
|
||||
instance.exports.call();
|
@ -151,12 +151,16 @@ WasmHandleThrow()
|
||||
|
||||
DebugFrame* frame = iter.debugFrame();
|
||||
|
||||
JSTrapStatus status = Debugger::onExceptionUnwind(cx, frame);
|
||||
if (status == JSTRAP_RETURN) {
|
||||
// Unexpected trap return -- raising error since throw recovery
|
||||
// is not yet implemented in the wasm baseline.
|
||||
// TODO properly handle JSTRAP_RETURN and resume wasm execution.
|
||||
JS_ReportErrorASCII(cx, "Unexpected resumption value from onExceptionUnwind");
|
||||
// Assume JSTRAP_ERROR status if no exception is pending --
|
||||
// no onExceptionUnwind handlers must be fired.
|
||||
if (cx->isExceptionPending()) {
|
||||
JSTrapStatus status = Debugger::onExceptionUnwind(cx, frame);
|
||||
if (status == JSTRAP_RETURN) {
|
||||
// Unexpected trap return -- raising error since throw recovery
|
||||
// is not yet implemented in the wasm baseline.
|
||||
// TODO properly handle JSTRAP_RETURN and resume wasm execution.
|
||||
JS_ReportErrorASCII(cx, "Unexpected resumption value from onExceptionUnwind");
|
||||
}
|
||||
}
|
||||
|
||||
bool ok = Debugger::onLeaveFrame(cx, frame, nullptr, false);
|
||||
|
Loading…
Reference in New Issue
Block a user