Skip to content

Commit d445b5a

Browse files
authored
Merge pull request #214 from alexcrichton/fix-lift-own
Fix lifting an own handle from a borrow handle
2 parents 114a0c5 + 72f6f5b commit d445b5a

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-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

design/mvp/canonical-abi/definitions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ def unpack_flags_from_int(i, labels):
544544

545545
def lift_own(cx, i, t):
546546
h = cx.inst.handles.remove(t.rt, i)
547+
trap_if(not h.own)
547548
return h.rep
548549

549550
def lift_borrow(cx, i, t):

0 commit comments

Comments
 (0)