Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Spec module global instantiation is incorrect #571

@CharlieTap

Description

@CharlieTap

As globals can now have initial expressions that point to other globals, it's not possible to compute all the initialiser expressions into a vector ahead of global allocation.

For example

(module (global $g i32 (i32.const 0)) (global i32 (global.get $g)))

The second initialiser here would call global.get on a yet to be allocated global

Instead we should probably do

for each global in module

  1. compute initial value
  2. allocate global

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