diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-21 04:22:53 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-21 04:22:53 +0000 |
commit | 62b1ebc20082e645ed8e8a0cc6c1ebf91577cd34 (patch) | |
tree | 880cb809ce1170ad97ddd35686c92e3a40b4b65a /pp_ctl.c | |
parent | 779c5bc9b377ace543a8d55375152f3503319113 (diff) | |
download | perl-62b1ebc20082e645ed8e8a0cc6c1ebf91577cd34.tar.gz |
fix handling of mayhaps-extended @_ in goto &sub
p4raw-id: //depot/perl@2030
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1873,6 +1873,7 @@ PP(pp_goto) SV** mark; I32 items = 0; I32 oldsave; + int arg_was_real = 0; retry: if (!CvROOT(cv) && !CvXSUB(cv)) { @@ -1917,7 +1918,10 @@ PP(pp_goto) SvREFCNT_dec(GvAV(PL_defgv)); GvAV(PL_defgv) = cx->blk_sub.savearray; #endif /* USE_THREADS */ - AvREAL_off(av); + if (AvREAL(av)) { + arg_was_real = 1; + AvREAL_off(av); /* so av_clear() won't clobber elts */ + } av_clear(av); } else if (CvXSUB(cv)) { /* put GvAV(defgv) back onto stack */ @@ -2073,7 +2077,11 @@ PP(pp_goto) } Copy(mark,AvARRAY(av),items,SV*); AvFILLp(av) = items - 1; - + /* preserve @_ nature */ + if (arg_was_real) { + AvREIFY_off(av); + AvREAL_on(av); + } while (items--) { if (*mark) SvTEMP_off(*mark); |