diff options
author | Hugo van der Sanden <hv@crypt.org> | 2004-03-05 17:42:25 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-03-23 13:43:49 +0000 |
commit | 547d1dd82362229be47f8169355ee7b5b98dd403 (patch) | |
tree | 4fd62b41b72056a8b236a89b7182ad4602939257 /pp_hot.c | |
parent | ae3f3efdef21cd5e7aaa929b0e067c679af06832 (diff) | |
download | perl-547d1dd82362229be47f8169355ee7b5b98dd403.tar.gz |
Fix bug [perl #27839] returning @+ out of scope loses its value :
Subject: Re: Wondering about returned regex special arrays on going out of scope
Message-Id: <200403051742.i25HgPd11240@zen.crypt.org>
plus a test case.
p4raw-id: //depot/perl@22564
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -778,7 +778,10 @@ PP(pp_rv2av) U32 i; for (i=0; i < (U32)maxarg; i++) { SV **svp = av_fetch(av, i, FALSE); - SP[i+1] = (svp) ? *svp : &PL_sv_undef; + /* See note in pp_helem, and bug id #27839 */ + SP[i+1] = svp + ? SvGMAGICAL(*svp) ? sv_mortalcopy(*svp) : *svp + : &PL_sv_undef; } } else { |