Skip to content

Commit 0a1797a

Browse files
committed
Fix lifting an own handle from a borrow handle
This fixes what I believe is a mistake in the `CanonicalABI.md` explainer currently where a lifting an owned resource handle from the table can succeed if the entry in the table was actually a borrowed handle. This inserts a check to ensure that the handle is an `own` handle before completing the lifting operation.
1 parent 114a0c5 commit 0a1797a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

design/mvp/CanonicalABI.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ component.
641641
```python
642642
def lift_own(cx, i, t):
643643
h = cx.inst.handles.remove(t.rt, i)
644+
trap_if(not h.own)
644645
return h.rep
645646
```
646647
The abstract lifted value for handle types is currently just the internal

0 commit comments

Comments
 (0)