From 49beac4814c9f4f107819fdd49700d8c7d84d40b Mon Sep 17 00:00:00 2001 From: Chip Salzenberg Date: Fri, 31 Jan 1997 20:56:47 +1200 Subject: [PATCH] Fix scalar leak in av_unshift --- av.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/av.c b/av.c index 554f2619a9..67f7880b8f 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) -- 2.34.1