From: Chip Salzenberg Date: Fri, 31 Jan 1997 08:56:47 +0000 (+1200) Subject: Fix scalar leak in av_unshift X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=49beac4814c9f4f107819fdd49700d8c7d84d40b;p=p5sagit%2Fp5-mst-13.2.git Fix scalar leak in av_unshift --- diff --git a/av.c b/av.c index 554f261..67f7880 100644 --- a/av.c +++ b/av.c @@ -199,9 +199,8 @@ SV *val; croak(no_modify); if (key > AvMAX(av)) av_extend(av,key); - if (AvREIFY(av)) + if (!AvREAL(av) && AvREIFY(av)) av_reify(av); - ary = AvARRAY(av); if (AvFILL(av) < key) { if (!AvREAL(av)) { @@ -385,12 +384,8 @@ register I32 num; return; if (SvREADONLY(av)) croak(no_modify); - if (!AvREAL(av)) { - if (AvREIFY(av)) - av_reify(av); - else - croak("Can't unshift"); - } + if (!AvREAL(av) && AvREIFY(av)) + av_reify(av); i = AvARRAY(av) - AvALLOC(av); if (i) { if (i > num)