-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix validation of resource methods in instance types (#1072)
This commit fixes an issue in `wasmparser`'s validation of component instance types where `[method]foo.bar`-style name mangling was erroneously considered invalid. This happened because registration of which names were valid to use only happened for components and component types, not for instance types. This is because the location that registered names of resources also did other validation which isn't required for instance types as that validation is deferred to later. This commit addresses the issue by moving the logic to register the names of resources above the short-circuit that skips the rest of the validation logic in the function.
- Loading branch information
1 parent
2c55ad6
commit 5b8ff53
Showing
3 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
14 changes: 14 additions & 0 deletions
14
tests/snapshots/local/component-model/resources.wast/110.print
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
(component | ||
(type (;0;) | ||
(component | ||
(type (;0;) | ||
(instance | ||
(export (;0;) "bar" (type (sub resource))) | ||
(type (;1;) (func)) | ||
(export (;0;) "[static]bar.a" (func (type 1))) | ||
) | ||
) | ||
(export (;0;) "x" (instance (type 0))) | ||
) | ||
) | ||
) |