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

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

Issue 2484803002: [wasm] Mutable globals cannot be imported (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/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 8c0f234f4432263e2d23b3adffbf5fa5b2ca13cc..5f31117a46acd8082c58b186109a818b9f2600d8 100644
--- a/test/unittests/wasm/module-decoder-unittest.cc
+++ b/test/unittests/wasm/module-decoder-unittest.cc
@@ -894,6 +894,37 @@ TEST_F(WasmModuleVerifyTest, ImportTable_nosigs1) {
EXPECT_VERIFIES(data);
}
+TEST_F(WasmModuleVerifyTest, ImportTable_mutable_global) {
+ {
+ static const byte data[] = {
+ SECTION(Import, 8), // section header
+ 1, // number of imports
+ NAME_LENGTH(1), // --
+ 'm', // module name
+ NAME_LENGTH(1), // --
+ 'f', // global name
+ kExternalGlobal, // import kind
+ kLocalI32, // type
+ 0, // mutability
+ };
+ EXPECT_VERIFIES(data);
+ }
+ {
+ static const byte data[] = {
+ SECTION(Import, 8), // section header
+ 1, // sig table
+ NAME_LENGTH(1), // --
+ 'm', // module name
+ NAME_LENGTH(1), // --
+ 'f', // global name
+ kExternalGlobal, // import kind
+ kLocalI32, // type
+ 1, // mutability
+ };
+ EXPECT_FAILURE(data);
+ }
+}
+
TEST_F(WasmModuleVerifyTest, ImportTable_nosigs2) {
static const byte data[] = {
SECTION(Import, 6), 1, // sig table
« 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