Skip to content

Commit 71eac54

Browse files
committed
Fix typo, correctly reference flatten_functype
1 parent f0487b2 commit 71eac54

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

design/mvp/CanonicalABI.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,11 +1478,11 @@ For a canonical definition:
14781478
(canon lift $callee:<funcidx> $opts:<canonopt>* (func $f (type $ft)))
14791479
```
14801480
validation specifies:
1481-
* `$callee` must have type `flatten($ft, 'lift')`
1481+
* `$callee` must have type `flatten_functype($ft, 'lift')`
14821482
* `$f` is given type `$ft`
14831483
* a `memory` is present if required by lifting and is a subtype of `(memory 1)`
14841484
* a `realloc` is present if required by lifting and has type `(func (param i32 i32 i32 i32) (result i32))`
1485-
* if a `post-return` is present, it has type `(func (param flatten($ft)['results']))`
1485+
* if a `post-return` is present, it has type `(func (param flatten_functype($ft)['results']))`
14861486

14871487
When instantiating component instance `$inst`:
14881488
* Define `$f` to be the closure `lambda call, args: canon_lift($opts, $inst, $callee, $ft, args)`
@@ -1544,7 +1544,7 @@ For a canonical definition:
15441544
(canon lower $callee:<funcidx> $opts:<canonopt>* (core func $f))
15451545
```
15461546
where `$callee` has type `$ft`, validation specifies:
1547-
* `$f` is given type `flatten($ft, 'lower')`
1547+
* `$f` is given type `flatten_functype($ft, 'lower')`
15481548
* a `memory` is present if required by lifting and is a subtype of `(memory 1)`
15491549
* a `realloc` is present if required by lifting and has type `(func (param i32 i32 i32 i32) (result i32))`
15501550
* there is no `post-return` in `$opts`
@@ -1581,8 +1581,9 @@ def canon_lower(opts, inst, callee, calling_import, ft, flat_args):
15811581

15821582
return flat_results
15831583
```
1584-
The definitions of `canon_lift` and `canon_lower` are mostly symmetric (swapping
1585-
lifting and lowering), with a few exceptions:
1584+
The definitions of `canon_lift` and `canon_lower` are mostly symmetric
1585+
(swapping lifting and lowering), with a few exceptions (in `flatten_functype`,
1586+
as defined above):
15861587
* The caller does not need a `post-return` function since the Core WebAssembly
15871588
caller simply regains control when `canon_lower` returns, allowing it to free
15881589
(or not) any memory passed as `flat_args`.

0 commit comments

Comments
 (0)