Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cross-module calls properly in the interpreter #6823

Open
kripken opened this issue Aug 7, 2024 · 1 comment
Open

Support cross-module calls properly in the interpreter #6823

kripken opened this issue Aug 7, 2024 · 1 comment

Comments

@kripken
Copy link
Member

kripken commented Aug 7, 2024

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)

@kripken
Copy link
Member Author

kripken commented Aug 7, 2024

Another option would be to make such literals point to the Module the thing is in, and still refer to it by name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant