Skip to content

vm: restore the caller's upper env around call_block - #97

Open
Dahrkael wants to merge 1 commit into
mrubyedge:masterfrom
Dahrkael:pr/1g-callblock-upper
Open

Dahrkael wants to merge 1 commit into
mrubyedge:masterfrom
Dahrkael:pr/1g-callblock-upper

Conversation

@Dahrkael

Copy link
Copy Markdown
Contributor

call_block set vm.upper to the callee's environ and, on return, derived the restore from the callee's environ chain. After a native->Ruby call that chain has no parent, so vm.upper was clobbered to None, breaking the upvar chain of the enclosing block. Snapshot and restore the caller's upper directly.

`call_block` set `vm.upper` to the callee's environ and, on return, derived the restore from the callee's environ chain. After a native->Ruby call that chain has no parent, so `vm.upper` was clobbered to `None`, breaking the upvar chain of the enclosing block. Snapshot and restore the caller's `upper` directly.
@udzura udzura self-assigned this Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants