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

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

Issue 2342593002: [wasm] void is not a valid type for a global. (Closed)
Patch Set: Created 4 years, 3 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 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;
}
« 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