Skip to content

Extended Constant Expressions

Extended const expressions allow more forms in places that require constants, like global initializers and element/data offsets.

(module
(global $base i32 (i32.const 100))
(global (export "copy_from") i32 (global.get $base))
)
(module
(type $t0 (func (param i32) (result i32)))
(func $id (type $t0) (param $x i32) (result i32)
(local.get $x))
(table 2 funcref)
(elem (i32.const 0) func $id)
)