Commit 78c0be52 authored by jbroman's avatar jbroman Committed by Commit bot

ValueSerializer: Promote scheduled exceptions from wasm::ErrorThrower.

wasm::ErrorThrower doesn't actually throw exceptions, it just schedules them.
As a result, this exception isn't handled properly by code which expects
ValueDeserializer to actually throw. For instance, the unit tests use a
TryCatch to catch and handle expected exceptions in unit tests.

Before this patch, I see local unit test failures because a wasm decode test
schedules one, but it isn't caught (and instead causes Context::New to fail
at the beginning of the next test).

BUG=685713

Review-Url: https://codereview.chromium.org/2659483004
Cr-Commit-Position: refs/heads/master@{#42718}
parent e6d13999
...@@ -1569,11 +1569,16 @@ MaybeHandle<JSObject> ValueDeserializer::ReadWasmModule() { ...@@ -1569,11 +1569,16 @@ MaybeHandle<JSObject> ValueDeserializer::ReadWasmModule() {
} }
// If that fails, recompile. // If that fails, recompile.
MaybeHandle<JSObject> result;
{
wasm::ErrorThrower thrower(isolate_, "ValueDeserializer::ReadWasmModule"); wasm::ErrorThrower thrower(isolate_, "ValueDeserializer::ReadWasmModule");
return wasm::CreateModuleObjectFromBytes( result = wasm::CreateModuleObjectFromBytes(
isolate_, wire_bytes.begin(), wire_bytes.end(), &thrower, isolate_, wire_bytes.begin(), wire_bytes.end(), &thrower,
wasm::ModuleOrigin::kWasmOrigin, Handle<Script>::null(), wasm::ModuleOrigin::kWasmOrigin, Handle<Script>::null(),
Vector<const byte>::empty()); Vector<const byte>::empty());
}
RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate_, JSObject);
return result;
} }
MaybeHandle<JSObject> ValueDeserializer::ReadHostObject() { MaybeHandle<JSObject> ValueDeserializer::ReadHostObject() {
......
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