Branch Coverage

av.c
Criterion Covered Total %
branch 289 412 70.1


line true false branch
35 141244 0 if (AvREAL(av))
42 3826213 141244 while (key > AvFILLp(av) + 1)
44 20100 141244 while (key) {
46 20087 13 if (sv != &PL_sv_undef)
47 20087 0 SvREFCNT_inc_simple_void(sv);
50 6387 141244 while (key)
74 245792 136896298 mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied);
75 139 137141951 if (mg) {
78 111 28 Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(EXTEND), G_DISCARD, 1,
94 128124280 9222590 if (key > *maxp) {
99 127919361 204919 if (av && *allocp != *arrayp) {
232241 127687120 if (av && *allocp != *arrayp) {
102 0 232241 Move(*arrayp, *allocp, AvFILLp(av)+1, SV*);
105 206813 25428 if (AvREAL(av)) {
106 953085 206813 while (tmp)
109 224489 7752 if (key > *maxp - 10) {
120 53719846 74172193 if (*allocp) {
0 53944335 if (*allocp) {
1 74172192 if (*allocp) {
145 0 53944335 Renew(*allocp,newmax+1, SV*);
151 25777 53918558 if (av == PL_curstack) { /* Oops, grew stack (via av_store()?) */
160 0 74172192 Newx(*allocp, newmax+1, SV*);
165 127911608 204919 if (av && AvREAL(av)) {
123551532 4360076 if (av && AvREAL(av)) {
166 1030406559 123551532 while (tmp)
196 30 0 if (mg) {
0 30 if (mg) {
198 30 0 SV * const ref = SvTIED_obj(MUTABLE_SV(av), mg);
200 26 4 if (SvROK(ref) && SvOBJECT(SvRV(ref))) {
26 0 if (SvROK(ref) && SvOBJECT(SvRV(ref))) {
204 18 8 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
18 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 18 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
1 17 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
1 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 1 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 17 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
17 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
17 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 17 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
0 0 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
17 1 if (negative_indices_glob && SvTRUE(GvSV(*negative_indices_glob)))
209 13 17 if (adjust_index) {
210 13 0 *keyp += AvFILL(av) + 1;
211 8 1 if (*keyp < 0)
225 605957 360067557 if (SvRMAGICAL(av)) {
228 603426 2531 if (tied_magic || mg_find((const SV *)av, PERL_MAGIC_regdata)) {
33380 570046 if (tied_magic || mg_find((const SV *)av, PERL_MAGIC_regdata)) {
230 18 35893 if (key < 0) {
231 16 0 if (!S_adjust_index(aTHX_ av, tied_magic, &key))
238 33380 2529 if (!tied_magic) /* for regdata, force leavesub to make copies */
246 2032945 358604658 if (key < 0) {
247 16404 2016541 key += AvFILL(av) + 1;
248 2032558 387 if (key < 0)
252 289376270 71260946 if (key > AvFILLp(av) || !AvARRAY(av)[key]) {
847147 288529123 if (key > AvFILLp(av) || !AvARRAY(av)[key]) {
254 70011882 2096220 return lval ? av_store(av,key,newSV(0)) : NULL;
257 45767369 242761754 if (AvREIFY(av)
258 45767369 0 && (!AvARRAY(av)[key] /* eg. @_ could have freed elts */
259 9 45767360 || SvIS_FREED(AvARRAY(av)[key]))) {
301 563619 930233076 if (SvRMAGICAL(av)) {
303 577 563042 if (tied_magic) {
304 0 577 if (key < 0) {
305 0 0 if (!S_adjust_index(aTHX_ av, tied_magic, &key))
308 577 0 if (val) {
316 0 930796118 if (key < 0) {
317 0 0 key += AvFILL(av) + 1;
318 0 0 if (key < 0)
322 0 930796118 if (SvREADONLY(av) && key >= AvFILL(av))
0 0 if (SvREADONLY(av) && key >= AvFILL(av))
0 0 if (SvREADONLY(av) && key >= AvFILL(av))
325 134476 930661642 if (!AvREAL(av) && AvREIFY(av))
134476 0 if (!AvREAL(av) && AvREIFY(av))
327 77666174 853129944 if (key > AvMAX(av))
330 909149886 21646231 if (AvFILLp(av) < key) {
331 0 909149886 if (!AvREAL(av)) {
332 0 0 if (av == PL_curstack && key > PL_stack_sp - PL_stack_base)
0 0 if (av == PL_curstack && key > PL_stack_sp - PL_stack_base)
336 0 0 } while (AvFILLp(av) < key);
340 21646231 0 else if (AvREAL(av))
343 274240 930521877 if (SvSMAGICAL(av)) {
346 274248 274240 for (; mg; mg = mg->mg_moremagic) {
347 4 274244 if (!isUPPER(mg->mg_type)) continue;
348 274244 0 if (val) {
349 274244 0 sv_magic(val, MUTABLE_SV(av), toLOWER(mg->mg_type), 0, key);
351 236582 37662 if (PL_delaymagic && mg->mg_type == PERL_MAGIC_isa) {
236582 0 if (PL_delaymagic && mg->mg_type == PERL_MAGIC_isa) {
356 37662 236578 if (set)
382 3619020 1527517 if (size) { /* "defined" was returning undef for size==0 anyway. */
65492 11776570 if (size) { /* "defined" was returning undef for size==0 anyway. */
385 0 3619020 Newx(ary,size,SV*);
392 11842062 3619018 for (i = 0; i < size; i++) {
440 1 23724643 if (SvREADONLY(av))
444 190199 23534444 if (SvRMAGICAL(av)) {
446 190190 9 if (PL_delaymagic && mg && mg->mg_type == PERL_MAGIC_isa)
182680 7510 if (PL_delaymagic && mg && mg->mg_type == PERL_MAGIC_isa)
452 17342767 6381876 if (AvMAX(av) < 0)
455 17223417 119350 if ((real = !!AvREAL(av))) {
460 58238647 17223417 while (index) {
469 868021 16474746 if (extra) {
474 17223417 119350 if (real) LEAVE;
496 2 2229592 if (SvTIED_mg((const SV *)av, PERL_MAGIC_tied))
0 2 if (SvTIED_mg((const SV *)av, PERL_MAGIC_tied))
499 2229594 0 if ((real = !!AvREAL(av))) {
503 474800719 2229594 while (key)
512 2 2229592 if(SvRMAGICAL(av)) mg_clear(MUTABLE_SV(av));
513 2229594 0 if(real) LEAVE;
531 23754 3888952 if (!*avp)
556 0 14337244 if (SvREADONLY(av))
559 37027 14300217 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
0 14337244 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
560 0 0 Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(PUSH), G_DISCARD, 1,
589 0 5980640 if (SvREADONLY(av))
591 22 5980618 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
19 5980621 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
592 12 7 retval = Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(POP), 0, 0);
593 19 0 if (retval)
597 3 5980618 if (AvFILL(av) < 0)
5709488 271133 if (AvFILL(av) < 0)
601 0 5709488 if (SvSMAGICAL(av))
603 5709488 0 return retval ? retval : &PL_sv_undef;
622 6398 7332 if (!*avp)
650 0 1971756 if (SvREADONLY(av))
653 638 1971118 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
0 1971756 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
654 0 0 Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(UNSHIFT),
659 1971258 498 if (num <= 0)
661 3951 1967307 if (!AvREAL(av) && AvREIFY(av))
3951 0 if (!AvREAL(av) && AvREIFY(av))
664 1440743 530515 if (i) {
665 416218 1024525 if (i > num)
673 534015 1437243 if (num) {
682 0 534015 Move(ary, ary + num, i + 1, SV*);
685 532650 534015 } while (num);
715 0 112520298 if (SvREADONLY(av))
717 16 112520282 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
12 112520286 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
718 5 7 retval = Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(SHIFT), 0, 0);
719 12 0 if (retval)
723 4 112520282 if (AvFILL(av) < 0)
109673041 2847245 if (AvFILL(av) < 0)
726 5312278 104360763 if (AvREAL(av))
731 0 109673041 if (SvSMAGICAL(av))
733 109673041 0 return retval ? retval : &PL_sv_undef;
786 1014 1603099 if (fill < 0)
788 25095 1579018 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
20 1604093 if ((mg = SvTIED_mg((const SV *)av, PERL_MAGIC_tied))) {
791 11 9 Perl_magic_methcall(aTHX_ MUTABLE_SV(av), mg, SV_CONST(STORESIZE), G_DISCARD,
795 1479494 124599 if (fill <= AvMAX(av)) {
799 0 1479494 if (AvREAL(av)) {
800 783964 1479494 while (key > fill) {
806 0 0 while (key < fill)
811 3 1479491 if (SvSMAGICAL(av))
838 0 109 if (SvREADONLY(av))
841 56 53 if (SvRMAGICAL(av)) {
844 27 29 if ((tied_magic || mg_find((const SV *)av, PERL_MAGIC_regdata))) {
0 27 if ((tied_magic || mg_find((const SV *)av, PERL_MAGIC_regdata))) {
846 3 26 if (key < 0) {
847 2 0 if (!S_adjust_index(aTHX_ av, tied_magic, &key))
851 28 0 if (svp) {
854 28 0 if (mg_find(sv, PERL_MAGIC_tiedelem)) {
863 0 80 if (key < 0) {
864 0 0 key += AvFILL(av) + 1;
865 0 0 if (key < 0)
869 52 28 if (key > AvFILLp(av))
872 1 51 if (!AvREAL(av) && AvREIFY(av))
1 0 if (!AvREAL(av) && AvREIFY(av))
875 30 22 if (key == AvFILLp(av)) {
879 2029 7 } while (--key >= 0 && !AvARRAY(av)[key]);
2006 23 } while (--key >= 0 && !AvARRAY(av)[key]);
883 0 52 if (SvSMAGICAL(av))
886 22 30 if (flags & G_DISCARD) {
890 30 0 else if (AvREAL(av))
914 103 1029512 if (SvRMAGICAL(av)) {
919 80 23 if (tied_magic || regdata_magic) {
922 9 71 if (key < 0) {
923 7 1 if (!S_adjust_index(aTHX_ av, tied_magic, &key))
927 0 78 if(key >= 0 && regdata_magic) {
928 0 0 if (key <= AvFILL(av))
0 0 if (key <= AvFILL(av))
937 78 0 if (mg) {
940 0 78 I32 retbool = SvTRUE_nomg_NN(sv);
0 0 I32 retbool = SvTRUE_nomg_NN(sv);
0 0 I32 retbool = SvTRUE_nomg_NN(sv);
77 1 I32 retbool = SvTRUE_nomg_NN(sv);
77 0 I32 retbool = SvTRUE_nomg_NN(sv);
77 0 I32 retbool = SvTRUE_nomg_NN(sv);
35 42 I32 retbool = SvTRUE_nomg_NN(sv);
0 35 I32 retbool = SvTRUE_nomg_NN(sv);
1 0 I32 retbool = SvTRUE_nomg_NN(sv);
1 0 I32 retbool = SvTRUE_nomg_NN(sv);
0 1 I32 retbool = SvTRUE_nomg_NN(sv);
0 0 I32 retbool = SvTRUE_nomg_NN(sv);
0 0 I32 retbool = SvTRUE_nomg_NN(sv);
948 0 1029535 if (key < 0) {
949 0 0 key += AvFILL(av) + 1;
950 0 0 if (key < 0)
954 584257 445278 if (key <= AvFILLp(av) && AvARRAY(av)[key])
285638 298619 if (key <= AvFILLp(av) && AvARRAY(av)[key])
972 7760 17660 if (!mg) {
1002 18 203 if (!mg->mg_ptr) {