diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-07-22 12:14:28 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-07-22 12:15:02 -0700 |
commit | 862b2c434beb1d61a19037a8449c8db953fd37a0 (patch) | |
tree | a9ccda6228a7cac23655f8e6666e86676557b7a4 /pp_ctl.c | |
parent | 40914f83eabd350b52615a215aeb2704f7332495 (diff) | |
download | perl-862b2c434beb1d61a19037a8449c8db953fd37a0.tar.gz |
Call get-magic on temp returned under recursion
This fixes a regression introduced in 5.15.0.
Commit 767eda44 made autovivification work with scalars returned from
lvalue subs. In doing so, as it made entersub an autovivifying op,
it had to add SvGETMAGIC calls to pp_return and pp_leavesub. (See
767eda44’s commit message for details.) In one spot in pp_return,
the SvGETMAGIC call was added to the wrong branch of an if/else con-
dition, causing a regression. Explicitly returning from a recursive
subroutine call in autovivifying context would not call get-magic on
the returned value.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2499,13 +2499,13 @@ PP(pp_return) *++newsp = SvREFCNT_inc(*SP); FREETMPS; sv_2mortal(*newsp); + if (gmagic) SvGETMAGIC(*newsp); } else { sv = SvREFCNT_inc(*SP); /* FREETMPS could clobber it */ FREETMPS; *++newsp = sv_mortalcopy(sv); SvREFCNT_dec(sv); - if (gmagic) SvGETMAGIC(sv); } } else if (SvTEMP(*SP) && SvREFCNT(*SP) == 1) { |