mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWasm: Reject indirect calls to external function references
This fixes a test in the WebAssembly spec test suite that was
added in 924c1f816d
This commit is contained in:
committed by
Andrew Kaster
parent
c4f7361a5b
commit
a3157c8c69
@@ -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()];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user