Skip to content

Comments

Fix panic when resource's owning interface is not otherwise implicitly imported#101

Merged
peterhuene merged 2 commits intobytecodealliance:mainfrom
rylev:panic-repro
May 1, 2024
Merged

Fix panic when resource's owning interface is not otherwise implicitly imported#101
peterhuene merged 2 commits intobytecodealliance:mainfrom
rylev:panic-repro

Conversation

@rylev
Copy link
Collaborator

@rylev rylev commented Apr 30, 2024

Fixes #99

The issue is that when the aggregator remaps resources, it does not keep track of whether the resource's owning interface needs to be implicitly imported or not. The tracking for implicitly imported types is kept in the names collection. After remapping a type, it is put into the names collection, and those imports are then encoded in wac_graph as imports.

If the owning interface is not otherwise implicitly or explicitly imported, there will be a panic because we assume the interface has been seen when we go to encode.

rylev added 2 commits April 30, 2024 13:49
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@rylev rylev requested a review from peterhuene April 30, 2024 15:13
Copy link
Member

@peterhuene peterhuene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just the one comment!

@peterhuene peterhuene merged commit f31c6bc into bytecodealliance:main May 1, 2024
@rylev rylev deleted the panic-repro branch May 2, 2024 08:12
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

Successfully merging this pull request may close these issues.

Panic on instantiation with resource with implicit use dependency

2 participants