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

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

Issue 2479283002: Revert of [wasm] Indirect calls without function table cause validation errors. (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 | « test/mjsunit/wasm/trap-location.js ('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 f73264168b3b8ab2dd6e121d4608245b17b44500..070767e7188a71fc9baeb9cbb813467e02738830 100644
--- a/test/unittests/wasm/ast-decoder-unittest.cc
+++ b/test/unittests/wasm/ast-decoder-unittest.cc
@@ -1311,11 +1311,6 @@
return result;
}
- void InitializeFunctionTable() {
- mod.function_tables.push_back(
- {0, 0, true, std::vector<int32_t>(), false, false, SignatureMap()});
- }
-
private:
WasmModule mod;
};
@@ -1426,7 +1421,6 @@
TEST_F(AstDecoderTest, SimpleIndirectCalls) {
FunctionSig* sig = sigs.i_i();
TestModuleEnv module_env;
- module_env.InitializeFunctionTable();
module = &module_env;
byte f0 = module_env.AddSignature(sigs.i_v());
@@ -1442,7 +1436,6 @@
TEST_F(AstDecoderTest, IndirectCallsOutOfBounds) {
FunctionSig* sig = sigs.i_i();
TestModuleEnv module_env;
- module_env.InitializeFunctionTable();
module = &module_env;
EXPECT_FAILURE_S(sig, WASM_CALL_INDIRECT0(0, WASM_ZERO));
@@ -1459,7 +1452,6 @@
TEST_F(AstDecoderTest, IndirectCallsWithMismatchedSigs3) {
FunctionSig* sig = sigs.i_i();
TestModuleEnv module_env;
- module_env.InitializeFunctionTable();
module = &module_env;
byte f0 = module_env.AddFunction(sigs.i_f());
@@ -1477,21 +1469,6 @@
EXPECT_FAILURE_S(sig, WASM_CALL_INDIRECT1(f1, WASM_ZERO, WASM_I8(16)));
EXPECT_FAILURE_S(sig, WASM_CALL_INDIRECT1(f1, WASM_ZERO, WASM_I64V_1(16)));
EXPECT_FAILURE_S(sig, WASM_CALL_INDIRECT1(f1, WASM_ZERO, WASM_F32(17.6)));
-}
-
-TEST_F(AstDecoderTest, IndirectCallsWithoutTableCrash) {
- FunctionSig* sig = sigs.i_i();
- TestModuleEnv module_env;
- module = &module_env;
-
- byte f0 = module_env.AddSignature(sigs.i_v());
- byte f1 = module_env.AddSignature(sigs.i_i());
- byte f2 = module_env.AddSignature(sigs.i_ii());
-
- EXPECT_FAILURE_S(sig, WASM_CALL_INDIRECT0(f0, WASM_ZERO));
- EXPECT_FAILURE_S(sig, WASM_CALL_INDIRECT1(f1, WASM_ZERO, WASM_I8(22)));
- EXPECT_FAILURE_S(
- sig, WASM_CALL_INDIRECT2(f2, WASM_ZERO, WASM_I8(32), WASM_I8(72)));
}
TEST_F(AstDecoderTest, SimpleImportCalls) {
« no previous file with comments | « test/mjsunit/wasm/trap-location.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698