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

Unified Diff: test/cctest/wasm/test-run-wasm.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 | « src/wasm/ast-decoder.cc ('k') | test/mjsunit/wasm/trap-location.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm.cc
diff --git a/test/cctest/wasm/test-run-wasm.cc b/test/cctest/wasm/test-run-wasm.cc
index 713a8604f0a9153041a7995f95c8fd4c7a2b4c71..ee532ae807174b823d49b75440f0794d353e9c3c 100644
--- a/test/cctest/wasm/test-run-wasm.cc
+++ b/test/cctest/wasm/test-run-wasm.cc
@@ -2672,6 +2672,28 @@
CHECK_TRAP(r.Call(2, 1, 0));
}
+WASM_EXEC_TEST(CallIndirect_NoTable) {
+ TestSignatures sigs;
+ TestingModule module(execution_mode);
+
+ // One function.
+ WasmFunctionCompiler t1(sigs.i_ii(), &module);
+ BUILD(t1, WASM_I32_ADD(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ t1.CompileAndAdd(/*sig_index*/ 1);
+
+ // Signature table.
+ module.AddSignature(sigs.f_ff());
+ module.AddSignature(sigs.i_ii());
+
+ // Builder the caller function.
+ WasmRunner<int32_t> r(&module, MachineType::Int32());
+ BUILD(r, WASM_CALL_INDIRECT2(1, WASM_GET_LOCAL(0), WASM_I8(66), WASM_I8(22)));
+
+ CHECK_TRAP(r.Call(0));
+ CHECK_TRAP(r.Call(1));
+ CHECK_TRAP(r.Call(2));
+}
+
WASM_EXEC_TEST(CallIndirect_EmptyTable) {
TestSignatures sigs;
TestingModule module(execution_mode);
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | test/mjsunit/wasm/trap-location.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698