in reply to Re^5: Use of freed value in iteration
in thread Use of freed value in iteration
I discussed it with Pali and he thinks it is a refcounting problem. It seems when iterating over values, the refcount of the current element is incremented, but all other elements keep their refcounts unchanged. Therefore, iterating over something doesn't prevent non-current elements from destruction. To see what happens,
and prependuse Devel::Peek;
to the beginning of the loop.Dump $hr3;
For loop is implemented by a stack: pp_hot.c and pp_ctl.c.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Use of freed value in iteration
by Danny (Chaplain) on Feb 13, 2024 at 16:35 UTC | |
by hv (Prior) on Feb 13, 2024 at 17:21 UTC | |
by syphilis (Archbishop) on Feb 14, 2024 at 00:11 UTC | |
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 | |
|