LibWasm: Reject indirect calls to external function references
Some checks failed
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, macos-14, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Push notes / build (push) Waiting to run
Build Dev Container Image / build (push) Has been cancelled

This fixes a test in the WebAssembly spec test suite that was
added in 924c1f816d
This commit is contained in:
Andrew Kaster 2024-10-14 17:58:48 -06:00 committed by Andrew Kaster
parent c4f7361a5b
commit a3157c8c69
Notes: github-actions[bot] 2024-10-15 00:15:08 +00:00

View file

@ -2109,8 +2109,8 @@ VALIDATE_INSTRUCTION(call_indirect)
TRY(validate(args.type));
auto& table = m_context.tables[args.table.value()];
if (!table.element_type().is_reference())
return Errors::invalid("table element type for call.indirect"sv, "a reference type"sv, table.element_type());
if (table.element_type().kind() != ValueType::FunctionReference)
return Errors::invalid("table element type for call.indirect"sv, "a function reference"sv, table.element_type());
auto& type = m_context.types[args.type.value()];