Skip to content

Support cross-module calls properly in the interpreter #6823

@kripken

Description

@kripken

Right now some things like function and tag literals store a name. The Literal for a RefFunc stores the name of the function, for example. That means we may refer to the wrong thing if the value is used in another module with different internal names.

To fix this, we could add direct references from the Literal for a function to the Function it refers to. Maybe a good way to do that is to give it a shared_ptr<Function>, in which case we'd want to make Modules store their functions as a vector of such shared pointers and not unique_ptrs etc.

This may not be urgent as it is a long-standing issue. If we ever start to do testing of cross-module calls in our interpreter then we'd need to fix it.

Noticed here: #6814 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions