This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
extend magic copy test to all scope exit types
authorDavid Mitchell <davem@iabyn.com>
Wed, 21 Oct 2015 18:10:34 +0000 (19:10 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 3 Feb 2016 09:18:32 +0000 (09:18 +0000)
commit86cc158350c1bc1d2159ec3dbf01e2800bca07dc
tree4fe7484be7b99f9c50aada3ef0aa972d036e233b
parentb28bb06c3ca3128edebf1b46812096d79b69de97
extend magic copy test to all scope exit types

Commit v5.15.6-387-g6f48390 forced leavesub to copy returned items
if they were get-magical. Normally rvalue subs  are supposed to return a
copy of their return args, but that copy is sometimes skipped if leavesub
thinks the side-effects will never be visible. Tied elements was an
example where the implementation leaked.

However, this applies equally well to other leave types, such as
do { ....}, so test for get magic in those too.
pp_ctl.c
t/op/gmagic.t