[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: Andreas Haas <ahaas@chromium.org> Cr-Commit-Position: refs/heads/master@{#55601}
This commit is contained in:
parent
84012551a8
commit
175f2a6a6c
@ -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 {};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user