Commit 175f2a6a authored by Stephan Herhut's avatar Stephan Herhut Committed by Commit Bot

[wasm] Throw a RuntimeError if memory lacks guard regions

WebAssembly.Instantiate would silently fail when the passed in memory
object did not have guard regions even though the compiled module assumes
so. This lead to an inconsitent state and a DCHECK error. Instead, now
throw a LinkError.

Change-Id: I68bab842bcc40d3325aea4b19979d80054ed407c
Reviewed-on: https://chromium-review.googlesource.com/1180892
Commit-Queue: Stephan Herhut <herhut@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55601}
parent 84012551
......@@ -1015,6 +1015,9 @@ MaybeHandle<WasmInstanceObject> InstanceBuilder::Build() {
if (!memory_tracker->HasFullGuardRegions(
memory_.ToHandleChecked()->backing_store())) {
if (!FLAG_wasm_trap_handler_fallback) {
thrower_->LinkError(
"Provided memory is lacking guard regions but fallback was "
"disabled.");
return {};
}
......
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