package table

import "github.com/tetratelabs/wazero/experimental/table"

Index

Functions

func LookupFunction

func LookupFunction(
	module api.Module, tableIndex uint32, tableOffset uint32,
	expectedParamTypes, expectedResultTypes []api.ValueType,
) api.Function

LookupFunction tries to get an api.Function from the table instance specified by `tableIndex` and `tableOffset` in the given api.Module. The user of this function must be well aware of the structure of the given api.Module, and the offset and table index must be valid. If this fails to find it, e.g. table is not found, table offset is out of range, violates the expected types, this panics according to the same semantics as call_indirect instruction: https://www.w3.org/TR/2022/WD-wasm-core-2-20220419/exec/instructions.html#xref-syntax-instructions-syntax-instr-control-mathsf-call-indirect-x-y

Note: the returned api.Function is always valid, i.e. not nil, if this returns without panic.

Source Files

lookup.go

Version
v1.9.0 (latest)
Published
Feb 18, 2025
Platform
linux/amd64
Imports
2 packages
Last checked
4 days ago

Tools for package owners.