Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1348)

Unified Diff: src/wasm/wasm-module.cc

Issue 2818903002: [wasm] Handle no memory case when memory is exported
Patch Set: q Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/wasm/wasm-objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-module.cc
diff --git a/src/wasm/wasm-module.cc b/src/wasm/wasm-module.cc
index 0e8054a9d895657d8db9aa561d6e9c6cf9a9a96f..a9bed84e47222581b8326aa227303ba6fb089c46 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1953,7 +1953,10 @@ class InstantiationHelper {
// If there was no imported WebAssembly.Memory object, create one.
Handle<JSArrayBuffer> buffer(instance->memory_buffer(), isolate_);
memory_object = WasmMemoryObject::New(
- isolate_, buffer,
+ isolate_,
+ (instance->has_memory_buffer())
+ ? handle(instance->memory_buffer())
+ : Handle<JSArrayBuffer>::null(),
(module_->max_mem_pages != 0) ? module_->max_mem_pages : -1);
instance->set_memory_object(*memory_object);
} else {
« no previous file with comments | « no previous file | src/wasm/wasm-objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698