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

Unified Diff: test/cctest/wasm/wasm-run-utils.h

Issue 2640453003: [wasm] Fix and tighten memory validation (Closed)
Patch Set: Comments 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 | « test/cctest/wasm/test-wasm-trap-position.cc ('k') | test/mjsunit/regress/wasm/regression-667745.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/wasm-run-utils.h
diff --git a/test/cctest/wasm/wasm-run-utils.h b/test/cctest/wasm/wasm-run-utils.h
index f85f4ca3e2ccec4cd5bdde5371e9128d69c366e6..64e801d8e267f375b96e6d3f6d92b89b448466ff 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -105,8 +105,10 @@ class TestingModule : public ModuleEnv {
void ChangeOriginToAsmjs() { module_.origin = kAsmJsOrigin; }
byte* AddMemory(uint32_t size) {
+ CHECK(!module_.has_memory);
CHECK_NULL(instance->mem_start);
CHECK_EQ(0, instance->mem_size);
+ module_.has_memory = true;
instance->mem_start = reinterpret_cast<byte*>(malloc(size));
CHECK(instance->mem_start);
memset(instance->mem_start, 0, size);
« no previous file with comments | « test/cctest/wasm/test-wasm-trap-position.cc ('k') | test/mjsunit/regress/wasm/regression-667745.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698