WasmFunctionValidator

WasmFunctionValidator

object WasmFunctionValidator

Validator of WasmFunction nodes.

From the docs:

  • The type C.types[x] must be defined in the context.
  • Let [t*^1] => [t?^2] be the function type C.types[x].
  • Let C′ be the same context as C, but with:

    • locals set to the sequence of value types t*^1 t*, concatenating parameters and locals,
    • labels set to the singular sequence containing only result type [t?^2].
    • return set to the result type [t?^2].
  • Under the context C′, the expression expr must be valid with type t?^2.
  • Then the function definition is valid with type [t*^1] => [t?^2].

Methods

visit

fun visit(node: WasmFunction, context: Module): Module

Validates the given node, and if necessary: its children (recursively, using other ValidationVisitor instances).

Parameters

Name Description
node: WasmFunction
context: Module

ReturnValue

Name Description
Module