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

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

Issue 2548223002: [wasm] Update WasmMemoryObject correctly when module memory is exported. (Closed)
Patch Set: Rebase Created 4 years 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 | test/mjsunit/regress/wasm/regression-670683.js » ('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 f57226cf2750fcbd9eedeed7ffe810fb19189dee..a81b344dcc83cb088d752f15b326677125316549 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1219,11 +1219,6 @@ class WasmInstanceBuilder {
LoadDataSegments(nullptr, 0);
}
- DCHECK(wasm::IsWasmInstance(*instance));
- if (instance->has_memory_object()) {
- instance->get_memory_object()->AddInstance(isolate_, instance);
- }
-
//--------------------------------------------------------------------------
// Set up the runtime support for the new instance.
//--------------------------------------------------------------------------
@@ -1247,6 +1242,14 @@ class WasmInstanceBuilder {
ProcessExports(code_table, instance);
//--------------------------------------------------------------------------
+ // Add instance to Memory object
+ //--------------------------------------------------------------------------
+ DCHECK(wasm::IsWasmInstance(*instance));
+ if (instance->has_memory_object()) {
+ instance->get_memory_object()->AddInstance(isolate_, instance);
+ }
+
+ //--------------------------------------------------------------------------
// Set up the indirect function tables for the new instance.
//--------------------------------------------------------------------------
if (function_table_count > 0) InitializeTables(code_table, instance);
@@ -1291,6 +1294,7 @@ class WasmInstanceBuilder {
}
}
+ //--------------------------------------------------------------------------
// Set up and link the new instance.
//--------------------------------------------------------------------------
{
« no previous file with comments | « no previous file | test/mjsunit/regress/wasm/regression-670683.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698