Skip to content
This repository was archived by the owner on Aug 17, 2022. It is now read-only.
This repository was archived by the owner on Aug 17, 2022. It is now read-only.

Aliasing outer imported modules forces modules to have per-instance runtime state #28

Closed
@alexcrichton

Description

@alexcrichton

One thing I tripped over recently when updating wasmtime's as proposed in #26 is that I believe when you alias an outer module's imported module then you're forcing each instantation to create new modules with new state.

For example a simple module like:

(module $PARENT
  (import "" (module $b))
  (module $a
    (instance (instantiate (module outer $PARENT $b))))

  (export "a" (module $a)))

each time you instantiate $PARENT then the "a" export will have different state because it has to reference whatever module was imported.

I was under the impression, however, that this was likely not intended. Does validation need to ensure that outer module aliases only refer to locally-defined modules? Or is this an intended feature and consequence for engines to implement?

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