table

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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

  • `module` is a module instance to look up the function.
  • `tableIndex` is the index of the table instance in the module.
  • `tableOffset` is the offset of the lookup target in the table.
  • `expectedParamTypes` and `expectedResultTypes` are used to check the type of the function found in the table.

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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL