Extended Constant Expressions
Extended const expressions allow more forms in places that require constants, like global initializers and element/data offsets.
global.get in initializers
Section titled “global.get in initializers”(module (global $base i32 (i32.const 100)) (global (export "copy_from") i32 (global.get $base)))ref.func and ref.null in element segments
Section titled “ref.func and ref.null in element segments”(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))Instruction Reference
Section titled “Instruction Reference”- Local & Global Instructions —
global.get - Reference Instructions —
ref.func,ref.null - Module Structure —
global,elem,data