Skip to content

where are instantiation-time initializers documented? #694

Closed
@ColinEberhardt

Description

@ColinEberhardt

The syntax for data segments includes an offset expression:

data::={𝖽𝖺𝗍𝖺 memidx, 𝗈𝖿𝖿𝗌𝖾𝗍 expr, 𝗂𝗇𝗂𝗍 vec(byte)}

Which is described as:

The offset is given by a constant expression.

However, in practice, this can either be a constant, or an (imported) global:

(global $a (import "m" "a") i32)
(data (get_global $a) "abc")
(data (i32.const 25) "abc")

I cannot find the this documented anywhere other than in the unofficial spec:

https://github.com/sunfishcode/wasm-reference-manual/blob/master/WebAssembly.md#instantiation-time-initializers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions