New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of freed value in iteration at perlbug line 6 #11287
Comments
From perlbug@plan9.deCreated by perlbug@plan9.deIt seems "for" does not keep references to the values it iterates over. The following script fails with "Use of freed value in iteration at ... line 6": my $a = my $b = { 1 => 1, 2 => 2 }; for (values %$a, values %$b) { The expected result would be no output (and 4 iterations). This is especially problematic as for cannot even detect this case Perl Info
|
From @AbigailOn Fri, Apr 29, 2011 at 02:21:40AM -0700, perlbug@plan9.de wrote:
The values entry in perlfunc says that values returned by C<< values >> A work-around: for (@{[values %$a, values %$b]}) { which forces copying the values. Abigail |
The RT System itself - Status changed from 'new' to 'open' |
From @LeontOn Fri, Apr 29, 2011 at 12:41 PM, Abigail <abigail@abigail.be> wrote:
The real issue it not that the values are aliases, but that the stack Leon |
Migrated from rt.perl.org#89548 (status was 'open')
Searchable as RT89548$
The text was updated successfully, but these errors were encountered: