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

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

Issue 2389263005: [wasm] grow_memory(0) is the same as memory_size() (Closed)
Patch Set: Created 4 years, 2 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 | test/cctest/wasm/test-run-wasm-module.cc » ('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 f4cf505f5a910761dda7ba846dcc2f4ee630be89..9791cd9f7a1d846864c5cec63d1efffdc69485e4 100644
--- a/src/wasm/wasm-module.cc
+++ b/src/wasm/wasm-module.cc
@@ -1822,6 +1822,9 @@ int32_t GetInstanceMemorySize(Isolate* isolate, Handle<JSObject> instance) {
int32_t GrowInstanceMemory(Isolate* isolate, Handle<JSObject> instance,
uint32_t pages) {
+ if (pages == 0) {
+ return GetInstanceMemorySize(isolate, instance);
+ }
Address old_mem_start = nullptr;
uint32_t old_size = 0, new_size = 0;
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698