forked from bytecodealliance/wasm-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix requiring memory for lowered functions (bytecodealliance#1150)
Currently component validation erroneously allows lowering a component function with lists/strings in parameters without a `memory` canonical option, despite this being required for the function. This commit fixes the issue and additionally refactors the code by renaming `import` to `is_lower` and renaming `requires_realloc` to `contains_ptr`.
- Loading branch information
1 parent
6684a5b
commit 64fee0e
Showing
3 changed files
with
54 additions
and
28 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
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,15 @@ | ||
(assert_invalid | ||
(component | ||
(import "f" (func $f (param "x" (list u8)))) | ||
(core func $f (canon lower (func $f) | ||
)) | ||
) | ||
"canonical option `memory` is required") | ||
|
||
(assert_invalid | ||
(component | ||
(import "f" (func $f (result (list u8)))) | ||
(core func $f (canon lower (func $f) | ||
)) | ||
) | ||
"canonical option `memory` is required") |