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

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

Issue 1961853002: [wasm] Verify expressions do not cross control boundaries in WASM. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment Created 4 years, 7 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/ast-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/ast-decoder-unittest.cc
diff --git a/test/unittests/wasm/ast-decoder-unittest.cc b/test/unittests/wasm/ast-decoder-unittest.cc
index 6991c822046537439dec51df45b340b9729d6cce..e88980e678013fbbb0bf90818e0b5c7f36b08d86 100644
--- a/test/unittests/wasm/ast-decoder-unittest.cc
+++ b/test/unittests/wasm/ast-decoder-unittest.cc
@@ -307,16 +307,30 @@ TEST_F(AstDecoderTest, Binops_off_end) {
byte code4[] = {kExprGetLocal, 0, 0, 0}; // [expr] [opcode] [opcode]
for (size_t i = 0; i < arraysize(kInt32BinopOpcodes); i++) {
- code4[1] = kInt32BinopOpcodes[i];
+ code4[2] = kInt32BinopOpcodes[i];
code4[3] = kInt32BinopOpcodes[i];
EXPECT_FAILURE(sigs.i_i(), code4);
}
}
+TEST_F(AstDecoderTest, BinopsAcrossBlock1) {
+ static const byte code[] = {WASM_ZERO, kExprBlock, WASM_ZERO, kExprI32Add,
+ kExprEnd};
+ EXPECT_FAILURE(sigs.i_i(), code);
+}
+
+TEST_F(AstDecoderTest, BinopsAcrossBlock2) {
+ static const byte code[] = {WASM_ZERO, WASM_ZERO, kExprBlock, kExprI32Add,
+ kExprEnd};
+ EXPECT_FAILURE(sigs.i_i(), code);
+}
+
+TEST_F(AstDecoderTest, BinopsAcrossBlock3) {
+ static const byte code[] = {WASM_ZERO, WASM_ZERO, kExprIf, kExprI32Add,
+ kExprElse, kExprI32Add, kExprEnd};
+ EXPECT_FAILURE(sigs.i_i(), code);
+}
-//===================================================================
-//== Statements
-//===================================================================
TEST_F(AstDecoderTest, Nop) {
static const byte code[] = {kExprNop};
EXPECT_VERIFIES(sigs.v_v(), code);
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698