in reply to Re^7: Use of freed value in iteration
in thread Use of freed value in iteration
Four months back, I built the then-current devel release (perl-5.39.3) with that flag added - just curious to see whether it did something it shouldn't be doing on Windows. (It was fine, of course.)@a = qw(aaa bbb); f(@a); sub f { # on entry, $_[0] is an alias of $a[0], # $_[1] is an alias of $a[1], print "@_\n"; # correctly prints "aaa bbb" @a = (); # this prematurely frees $_[0] and $_[1] # this causes the two just-freed SVs to be reallocated my $x = 'xxx:yyy'; my @x = split /:/, $x; # but the two reallocated SVs are still referenced by @_ print "@_\n"; # incorrectly prints "xxx yyy" }
But there are still other aspects of the issue to be addressed, upon which Dave continues to work.aaa bbb aaa bbb
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^9: Use of freed value in iteration
by Danny (Chaplain) on Feb 24, 2024 at 21:48 UTC | |
by dave_the_m (Monsignor) on Feb 25, 2024 at 12:16 UTC | |
by Danny (Chaplain) on Feb 25, 2024 at 21:58 UTC | |
by dave_the_m (Monsignor) on Feb 25, 2024 at 22:42 UTC |