Actions
Bug #11594
closedA Proc call may corrupt a local variable
Description
x, y, z = 1, 2, 3
p [x, y, z] #=> [1, 2, 3]
-> &blk { }.call &:foo
p [x, y, z] #=> [false, 2, 3] !!! WRONG !!!
The proc call in Line 3 modifies a local variable.
git bisect showed r52056. I confirmed it worked fine when I revert the commit.
-
rb_sym_to_proc
creates a Proc instance, -
rb_sym_to_proc
callsrb_block_clear_env_self
, and -
rb_block_clear_env_self
seems to break the variable, instead of clearing self.
I guess rb_sym_to_proc
creates an inconsistent Proc, but I don't know what is happening precisely.
--
Yusuke Endoh mame@ruby-lang.org
Actions
Like0
Like0Like0