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 10e23300e5c7ca1b4f587f16d46ddcbe75e17c07..fc66e3b29ff0c7ec51f35e3185143eff9532afd5 100644 |
--- a/test/unittests/wasm/module-decoder-unittest.cc |
+++ b/test/unittests/wasm/module-decoder-unittest.cc |
@@ -201,6 +201,21 @@ TEST_F(WasmModuleVerifyTest, OneGlobal) { |
EXPECT_OFF_END_FAILURE(data, 1, sizeof(data)); |
} |
+TEST_F(WasmModuleVerifyTest, Global_invalid_type) { |
+ static const byte data[] = { |
+ SECTION(GLOBALS, 5), // -- |
+ 1, |
+ NAME_LENGTH(1), |
+ 'g', // name |
+ 64, // invalid memory type |
+ 0, // exported |
+ }; |
+ |
+ ModuleResult result = DecodeModuleNoHeader(data, data + sizeof(data)); |
+ EXPECT_FALSE(result.ok()); |
+ if (result.val) delete result.val; |
+} |
+ |
TEST_F(WasmModuleVerifyTest, ZeroGlobals) { |
static const byte data[] = { |
SECTION(GLOBALS, 1), // -- |