Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Allow mutable global imports to be used in init expressions? #5

@lars-t-hansen

Description

@lars-t-hansen

This is actually a somewhat compelling use case:

(module
  (global $g1 (import "foo" "bar") (mut i32))
  (global $g2 i32 (get_global $g1)))

My understanding from Luke is that previously, we did not allow global initializers to reference mutable globals in order to avoid circularities in initialization (not the only way to avoid that but an obvious way). With importable mutable globals there would not have been a circularity problem in referencing them from initializers, but we did not have importable mutable globals. Now we do. So should we lift the restriction to allow the above example to work?

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