From ce9f3c9c0043030e2d05cbb64bbfd4d50fc94b6b Mon Sep 17 00:00:00 2001 From: Richard Leach Date: Fri, 2 Apr 2021 23:51:45 +0100 Subject: av_extend_guts: set correct ary_offset when unshifting an array (GH#18667) --- av.c | 1 + 1 file changed, 1 insertion(+) (limited to 'av.c') diff --git a/av.c b/av.c index ff0cb2340c..bf19c439c4 100644 --- a/av.c +++ b/av.c @@ -110,6 +110,7 @@ Perl_av_extend_guts(pTHX_ AV *av, SSize_t key, SSize_t *maxp, SV ***allocp, if (av && *allocp != *arrayp) { /* a shifted SV* array exists */ to_null = *arrayp - *allocp; *maxp += to_null; + ary_offset = AvFILLp(av) + 1; Move(*arrayp, *allocp, AvFILLp(av)+1, SV*); -- cgit v1.2.1