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

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

Issue 2638003002: [wasm] Check for malformed mutability (Closed)
Patch Set: Add unittest 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/module-decoder.cc ('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 3a1d7fe1774c6cb949b2afb954b38f8d50138029..5d8b60b0fc00750257ec792bebbae1586d0c610e 100644
--- a/test/unittests/wasm/module-decoder-unittest.cc
+++ b/test/unittests/wasm/module-decoder-unittest.cc
@@ -1101,6 +1101,21 @@ TEST_F(WasmModuleVerifyTest, ImportTable_mutable_global) {
}
}
+TEST_F(WasmModuleVerifyTest, ImportTable_mutability_malformed) {
+ static const byte data[] = {
+ SECTION(Import, 8),
+ 1, // --
+ NAME_LENGTH(1), // --
+ 'm', // module name
+ NAME_LENGTH(1), // --
+ 'g', // global name
+ kExternalGlobal, // import kind
+ kLocalI32, // type
+ 2, // invalid mutability
+ };
+ EXPECT_FAILURE(data);
+}
+
TEST_F(WasmModuleVerifyTest, ImportTable_nosigs2) {
static const byte data[] = {
SECTION(Import, 6), 1, // sig table
@@ -1507,7 +1522,6 @@ TEST_F(WasmModuleVerifyTest, Multiple_Named_Sections) {
};
EXPECT_VERIFIES(data);
}
-
} // namespace wasm
} // namespace internal
} // namespace v8
« no previous file with comments | « src/wasm/module-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698