diff options
author | Andy Lester <andy@petdance.com> | 2006-04-10 18:51:50 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-04-11 07:54:23 +0000 |
commit | d39614506f118e8a474f0a8c4b7f7cd7e0e74f51 (patch) | |
tree | 50de03e7f9adc557dbfbfa01caff494a35996ece /pp.c | |
parent | b5a2f8d883d38be33345ce4afe970bc14be51e58 (diff) | |
download | perl-d39614506f118e8a474f0a8c4b7f7cd7e0e74f51.tar.gz |
Quiet a coverity problem
Message-ID: <20060411045150.GA1422@petdance.com>
p4raw-id: //depot/perl@27763
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -4053,7 +4053,6 @@ PP(pp_splice) I32 newlen; I32 after; I32 diff; - SV **tmparyval = NULL; const MAGIC * const mg = SvTIED_mg((SV*)ary, PERL_MAGIC_tied); if (mg) { @@ -4119,6 +4118,7 @@ PP(pp_splice) } if (diff < 0) { /* shrinking the area */ + SV **tmparyval; if (newlen) { Newx(tmparyval, newlen, SV*); /* so remember insertion */ Copy(MARK, tmparyval, newlen, SV*); @@ -4179,15 +4179,14 @@ PP(pp_splice) } } else { /* no, expanding (or same) */ + SV** tmparyval = NULL; if (length) { Newx(tmparyval, length, SV*); /* so remember deletion */ Copy(AvARRAY(ary)+offset, tmparyval, length, SV*); } if (diff > 0) { /* expanding */ - /* push up or down? */ - if (offset < after && diff <= AvARRAY(ary) - AvALLOC(ary)) { if (offset) { src = AvARRAY(ary); @@ -4228,7 +4227,6 @@ PP(pp_splice) dst++; } } - Safefree(tmparyval); } MARK += length - 1; } @@ -4239,10 +4237,10 @@ PP(pp_splice) while (length-- > 0) SvREFCNT_dec(tmparyval[length]); } - Safefree(tmparyval); } else *MARK = &PL_sv_undef; + Safefree(tmparyval); } SP = MARK; RETURN; |