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

Unified Diff: test/cctest/wasm/test-run-wasm-interpreter.cc

Issue 2627943002: [wasm] The interpreter should not grow memory beyond module->mem_max_pages. (Closed)
Patch Set: Comments addressed Created 3 years, 11 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 | « src/wasm/wasm-interpreter.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm-interpreter.cc
diff --git a/test/cctest/wasm/test-run-wasm-interpreter.cc b/test/cctest/wasm/test-run-wasm-interpreter.cc
index 514c08a0998e2e9b625e1830e986236f706891ca..71744ae69d87044a49c3487af92011f01b88c576 100644
--- a/test/cctest/wasm/test-run-wasm-interpreter.cc
+++ b/test/cctest/wasm/test-run-wasm-interpreter.cc
@@ -297,10 +297,20 @@ TEST(Breakpoint_I32And_disable) {
}
TEST(GrowMemory) {
- WasmRunner<int32_t, uint32_t> r(kExecuteInterpreted);
- r.module().AddMemory(WasmModule::kPageSize);
- BUILD(r, WASM_GROW_MEMORY(WASM_GET_LOCAL(0)));
- CHECK_EQ(1, r.Call(1));
+ {
+ WasmRunner<int32_t, uint32_t> r(kExecuteInterpreted);
+ r.module().AddMemory(WasmModule::kPageSize);
+ r.module().SetMaxMemPages(10);
+ BUILD(r, WASM_GROW_MEMORY(WASM_GET_LOCAL(0)));
+ CHECK_EQ(1, r.Call(1));
+ }
+ {
+ WasmRunner<int32_t, uint32_t> r(kExecuteInterpreted);
+ r.module().AddMemory(WasmModule::kPageSize);
+ r.module().SetMaxMemPages(10);
+ BUILD(r, WASM_GROW_MEMORY(WASM_GET_LOCAL(0)));
+ CHECK_EQ(-1, r.Call(11));
+ }
}
TEST(GrowMemoryPreservesData) {
« no previous file with comments | « src/wasm/wasm-interpreter.cc ('k') | test/cctest/wasm/wasm-run-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698