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 6716ed766ab45222b8b5e083c9b070bee255e4e9..7e8f86eead1a0d31bdf1414a3ccb95dbb06b411d 100644 |
--- a/test/unittests/wasm/module-decoder-unittest.cc |
+++ b/test/unittests/wasm/module-decoder-unittest.cc |
@@ -213,7 +213,22 @@ TEST_F(WasmModuleVerifyTest, Global_invalid_type) { |
0, // exported |
}; |
- ModuleResult result = DecodeModuleNoHeader(data, data + sizeof(data)); |
+ ModuleResult result = DecodeModule(data, data + sizeof(data)); |
+ EXPECT_FALSE(result.ok()); |
+ if (result.val) delete result.val; |
+} |
+ |
+TEST_F(WasmModuleVerifyTest, Global_invalid_type2) { |
+ static const byte data[] = { |
+ SECTION(GLOBALS, 5), // -- |
+ 1, |
+ NAME_LENGTH(1), |
+ 'g', // name |
+ kLocalVoid, // invalid memory type |
+ 0, // exported |
+ }; |
+ |
+ ModuleResult result = DecodeModule(data, data + sizeof(data)); |
EXPECT_FALSE(result.ok()); |
if (result.val) delete result.val; |
} |