On 2023-02-27 13:17, demerphq wrote: > On Mon, 27 Feb 2023 at 12:45, Ruud H.G. van Tol via perl5-porters > <perl5-porters@perl.org> wrote: > > I don't see (yet) how/why it should print out "foo".\ > > Why would you want/expect it to print "foo", > when you are using aliased parameters, > and are deliberately emptying the array? > > > Because the scalar that holds "foo" has been pushed onto the stack > independently of the array that originally contains it. The fact that > perl aliases arguments is a key part of this bug. If the stack was > refcounted the alias would not be freed until the scalar was popped > from the stack. OK, so then it (partly) comes down to what one interprets (?) as aliasing. I still think it was fine to print nothing (or to complain about undefined). The "prematurely freed" thing is then (IMO) another issue. In my view, that free() should remain in a cleanup-queue until the (intermediately undef-ed) value is no longer "busy". So the "prematurely freed" is certainly a bug, but he undef-ing should IMO still happen, as that is just what the code does. -- RuudThread Previous | Thread Next