Constant Expression
For the initialization expressions of globals, tables, offsets and element segments, they must be constant.
To be a constant expression, it must only contain the following instructions:
*.consti32.addi32.subi32.muli64.addi64.subi64.mulglobal.getref.nullref.i31ref.funcstruct.newstruct.new_defaultarray.newarray.new_defaultarray.new_fixedany.convert_externextern.convert_any
Constant expression example:
wasm
(module
(global i32
i32.const 2))Non-constant expression example:
wasm
(module
(global f32
f32.const 1.0
f32.const 2.0
f32.add))