Commit d28af94b authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[asm.js] Improve error reporting of internal failures.

R=sigurds@chromium.org

Change-Id: I54df6ab72a3d6836be15d4a26b8a1615628eb872
Reviewed-on: https://chromium-review.googlesource.com/1163703Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54935}
parent 28a480e0
......@@ -392,8 +392,14 @@ MaybeHandle<Object> AsmJs::InstantiateAsmWasm(Isolate* isolate,
// An exception caused by the module start function will be set as pending
// and bypass the {ErrorThrower}, this happens in case of a stack overflow.
if (isolate->has_pending_exception()) isolate->clear_pending_exception();
if (thrower.error()) {
ScopedVector<char> error_reason(100);
SNPrintF(error_reason, "Internal wasm failure: %s", thrower.error_msg());
ReportInstantiationFailure(script, position, error_reason.start());
} else {
ReportInstantiationFailure(script, position, "Internal wasm failure");
}
thrower.Reset(); // Ensure exceptions do not propagate.
ReportInstantiationFailure(script, position, "Internal wasm failure");
return MaybeHandle<Object>();
}
DCHECK(!thrower.error());
......
......@@ -123,6 +123,7 @@ class V8_EXPORT_PRIVATE ErrorThrower {
bool error() const { return error_type_ != kNone; }
bool wasm_error() { return error_type_ >= kFirstWasmError; }
const char* error_msg() { return error_msg_.c_str(); }
Isolate* isolate() const { return isolate_; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment