components: ignore export aliases to types in translation.#4604
Merged
peterhuene merged 3 commits intobytecodealliance:mainfrom Aug 4, 2022
Merged
Conversation
alexcrichton
reviewed
Aug 4, 2022
Member
alexcrichton
left a comment
There was a problem hiding this comment.
I think that this may end up necessitating a more complete implementation of type exports because of the issue I commented on below, namely that aliasing into the current module modfies the index space and that needs to be accounted for.
Also ideally I would prefer if we can keep this out of the inline.rs path if possible because type information should be static enough that inlining and dataflow shouldn't be necessary to figure out what the type is.
Finally, could you be sure to add some tests which exercise these paths as well?
alexcrichton
approved these changes
Aug 4, 2022
Member
alexcrichton
left a comment
There was a problem hiding this comment.
Looks good to me with a test added!
added 3 commits
August 4, 2022 14:26
Currently, translation is ignoring type exports from components during translation by skipping over them before adding them to the exports map. If a component instantiates an inner component and aliases a type export of that instance, it will cause wasmtime to panic with a failure to find the export in the exports map. The fix is to add a representation for exported types to the map that is simply ignored when encountered. This also makes it easier to track places where we would have to support type exports in translation in the future.
This commit keeps the type information for type exports so that types can be properly aliased from an instance export and thereby adjusting the type index space accordingly.
7c5a0ba to
56058a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, translation is ignoring type exports from components during
translation by skipping over them before adding them to the exports map.
If a component instantiates an inner component and aliases a type export of
that instance, it will cause wasmtime to panic with a failure to find the
export in the exports map.
The fix is to add a representation for exported types to the map that is simply
ignored when encountered. This also makes it easier to track places where we
would have to support type exports in translation in the future.