summaryrefslogtreecommitdiff
path: root/mro.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-06-30 20:26:34 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-07-25 23:48:02 -0700
commit137da2b05b4b7628115049f343163bdaf2c30dbb (patch)
treef67f94858229947447c68a9676d49af49c593d4b /mro.c
parentd2440203227a535b62a2078d898d0bd993ceac78 (diff)
downloadperl-137da2b05b4b7628115049f343163bdaf2c30dbb.tar.gz
[perl #79908] Stop sub inlining from breaking closures
When a closure closes over a variable, it references the variable itself, as opposed to taking a snapshot of its value. This was broken by the constant optimisation added for constant.pm’s sake: { my $x; sub () { $x }; # takes a snapshot of the current value of $x } constant.pm no longer uses that mechanism, except on older perls, so we can remove this hack, causing code like this this to start work- ing again: BEGIN{ my $x = 5; *foo = sub(){$x}; $x = 6 } print foo; # now prints 6, not 5
Diffstat (limited to 'mro.c')
0 files changed, 0 insertions, 0 deletions