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

Unified Diff: test/unittests/wasm/module-decoder-unittest.cc

Issue 2486973003: [wasm] Data section without memory causes a validation error (Closed)
Patch Set: Created 4 years, 1 month 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-module.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/wasm/module-decoder-unittest.cc
diff --git a/test/unittests/wasm/module-decoder-unittest.cc b/test/unittests/wasm/module-decoder-unittest.cc
index 746d472372450be9f2fbbd73e53ebab0c918b0cf..f254358fc90dfbb8923d199289eca95ff0f57cdd 100644
--- a/test/unittests/wasm/module-decoder-unittest.cc
+++ b/test/unittests/wasm/module-decoder-unittest.cc
@@ -516,6 +516,20 @@ TEST_F(WasmModuleVerifyTest, TwoDataSegments) {
EXPECT_OFF_END_FAILURE(data, 14, sizeof(data));
}
+TEST_F(WasmModuleVerifyTest, DataWithoutMemory) {
+ const byte data[] = {
+ SECTION(Data, 11),
+ ENTRY_COUNT(1),
+ LINEAR_MEMORY_INDEX_0,
+ WASM_INIT_EXPR_I32V_3(0x9bbaa), // dest addr
+ U32V_1(3), // source size
+ 'a',
+ 'b',
+ 'c' // data bytes
+ };
+ EXPECT_FAILURE(data);
+}
+
TEST_F(WasmModuleVerifyTest, MaxMaximumMemorySize) {
{
const byte data[] = {
« no previous file with comments | « src/wasm/wasm-module.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698