Branch Coverage

lib/Devel/MAT/Dumper.xs
Criterion Covered Total %
branch 225 388 57.9


line true false branch
70 0 0 if(!tmpsv)
257 21684 12752 if(s)
301 53469 62004 if(o->op_flags & OPf_KIDS) {
302 59981 53426 for (kid = ((UNOP*)o)->op_first; kid; kid = OpSIBLING(kid)) {
113407 53469 for (kid = ((UNOP*)o)->op_first; kid; kid = OpSIBLING(kid)) {
307 0 115473 if(OP_CLASS(o) == OA_PMOP &&
617 114856 if(OP_CLASS(o) == OA_PMOP &&
583 34 if(OP_CLASS(o) == OA_PMOP &&
310 45 538 o->op_type != OP_SPLIT &&
326 262 58784 write_svptr(fh, SvOBJECT(sv) ? (SV*)SvSTASH(sv) : NULL);
331 5773 0 write_common_sv(fh, (const SV *)gv,
332 0 5773 sizeof(XPVGV) + (isGV_with_GP(gv) ? sizeof(struct gp) : 0));
334 5773 0 if(isGV_with_GP(gv)) {
5773 0 if(isGV_with_GP(gv)) {
345 5773 0 write_svptr(fh, (SV*)GvIO(gv));
5773 0 write_svptr(fh, (SV*)GvIO(gv));
5773 0 write_svptr(fh, (SV*)GvIO(gv));
350 5773 0 write_str(fh, GvFILE(gv));
375 4503 18088 switch(SvTYPE(sv)) {
384 17831 4760 if(SvPOK(sv))
386 0 22591 if(SvOOK(sv)) {
388 0 0 SvOOK_offset(sv, offset);
0 0 SvOOK_offset(sv, offset);
395 22585 6 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
22340 251 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
4760 17831 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
22563 28 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
400 4756 17835 write_uint(fh, SvIOK(sv) ? SvUVX(sv) : 0);
401 251 22340 write_nv(fh, SvNOK(sv) ? SvNVX(sv) : 0.0);
402 17831 4760 write_uint(fh, SvPOK(sv) ? SvCUR(sv) : 0);
412 17831 4760 if(SvPOK(sv)) {
414 17831 0 if(max_string > -1 && len > max_string)
10 17821 if(max_string > -1 && len > max_string)
444 1 5180 int len = (av == PL_curstack) ? (PL_stack_sp - PL_stack_base + 1) :
456 35363 5181 for(i = 0; i < len; i++)
465 929 173 if(HvARRAY(hv)) {
467 29740 929 for(bucket = 0; bucket <= HvMAX(hv); bucket++) {
471 17231 29740 for(he = HvARRAY(hv)[bucket]; he; he = he->hent_next) {
475 5758 11473 if(!HvSHAREKEYS(hv))
494 27628 906 for(bucket = 0; bucket <= HvMAX(hv); bucket++) {
496 17231 27628 for(he = HvARRAY(hv)[bucket]; he; he = he->hent_next) {
498 0 17231 char *key = HePV(he, len);
0 0 char *key = HePV(he, len);
500 11473 5758 write_svptr(fh, is_strtab ? NULL : HeVAL(he));
513 68 794 if(SvOOK(hv) && HvAUX(hv))
68 0 if(SvOOK(hv) && HvAUX(hv))
519 689 173 if(HvARRAY(hv) && nkeys)
666 23 if(HvARRAY(hv) && nkeys)
527 240 0 if(SvOOK(stash) && HvAUX(stash))
240 0 if(SvOOK(stash) && HvAUX(stash))
531 175 65 if(mro_meta) {
558 65 175 int nkeys = write_hv_header(fh, stash,
569 240 0 write_str(fh, HvNAME(stash));
240 0 write_str(fh, HvNAME(stash));
0 240 write_str(fh, HvNAME(stash));
0 0 write_str(fh, HvNAME(stash));
240 0 write_str(fh, HvNAME(stash));
0 240 write_str(fh, HvNAME(stash));
572 240 0 if(HvARRAY(stash))
579 2348 2242 PADLIST *pl = (is_xsub ? NULL : CvPADLIST(cv));
593 2348 2242 if(!CvISXSUB(cv) && !CvCONST(cv) && (start = CvSTART(cv))) {
2345 3 if(!CvISXSUB(cv) && !CvCONST(cv) && (start = CvSTART(cv))) {
2125 220 if(!CvISXSUB(cv) && !CvCONST(cv) && (start = CvSTART(cv))) {
594 2018 107 if(start->op_type == OP_NEXTSTATE)
598 4401 189 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
2348 2242 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
4491 99 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
4191 399 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
4590 0 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
612 2348 2242 if(!is_xsub && !CvCONST(cv))
2345 3 if(!is_xsub && !CvCONST(cv))
622 0 4590 if(CvNAMED(cv))
634 1590 3000 if(CvCONST(cv))
640 4484 106 if(CvFILE(cv))
646 0 4590 if(CvNAMED(cv))
653 1 4589 if(cv == PL_main_cv && PL_main_root)
1 0 if(cv == PL_main_cv && PL_main_root)
658 2347 2242 else if(!is_xsub && !CvCONST(cv) && CvROOT(cv))
2344 3 else if(!is_xsub && !CvCONST(cv) && CvROOT(cv))
2020 324 else if(!is_xsub && !CvCONST(cv) && CvROOT(cv))
662 2128 2462 if(pl) {
675 18556 2128 for(padix = 1; padix <= padix_max; padix++) {
677 559 17997 if(!pn)
685 3429 14568 if(PadnameFLAGS(pn)) {
688 767 2662 if(PadnameOUTER(pn)) flags |= 0x01;
689 61 3368 if(PadnameIsSTATE(pn)) flags |= 0x02;
690 2573 856 if(PadnameLVALUE(pn)) flags |= 0x04;
691 0 3429 if(PadnameFLAGS(pn) & PADNAMEt_TYPED) flags |= 0x08;
692 419 3010 if(PadnameFLAGS(pn) & PADNAMEt_OUR) flags |= 0x10;
694 3429 0 if(flags) {
715 2138 2128 for(depth = 1; depth <= PadlistMAX(pl); depth++) {
727 0 4590 FREETMPS;
816 0 0 while(p <= SP) {
817 0 0 unsigned char type = SvIV(p[0]);
818 0 0 switch(type) {
823 0 0 write_strn(fh, SvPV_nolen(p[3]), SvCUR(p[3])); /* annotation */
840 2819 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
2819 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 2819 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
2819 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 2819 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
2819 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
2819 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 2819 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
2819 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 2819 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 2819 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
841 0 0 helper = (DMD_Helper *)SvUV(*svp);
843 0 2819 if(helper) {
849 0 0 if(ret > 0)
852 0 0 FREETMPS;
857 2109 710 if((svp = hv_fetchs(stash, "ISA", 0)) &&
2109 0 if((svp = hv_fetchs(stash, "ISA", 0)) &&
858 2109 0 SvTYPE(*svp) == SVt_PVGV &&
859 2109 0 (isa_av = GvAV((GV *)*svp)) &&
860 2109 0 AvFILL(isa_av) > -1) {
862 4666 0 for(i = 0; i <= AvFILL(isa_av); i++) {
2557 2109 for(i = 0; i <= AvFILL(isa_av); i++) {
882 23145 2296 type = SvROK(sv) ? PMAT_SVtREF : PMAT_SVtSCALAR; break;
902 308 794 if(HvNAME(sv))
240 68 if(HvNAME(sv))
0 240 if(HvNAME(sv))
0 0 if(HvNAME(sv))
240 0 if(HvNAME(sv))
0 240 if(HvNAME(sv))
0 240 if(HvNAME(sv))
918 23145 35901 if(type == PMAT_SVtSCALAR && !SvOK(sv))
554 22591 if(type == PMAT_SVtSCALAR && !SvOK(sv))
554 0 if(type == PMAT_SVtSCALAR && !SvOK(sv))
554 0 if(type == PMAT_SVtSCALAR && !SvOK(sv))
953 4831 54215 if(SvMAGICAL(sv)) {
955 4831 4831 for(mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
961 2 4829 if(mg->mg_len == HEf_SVKEY)
967 0 4831 if(mg->mg_type == PERL_MAGIC_ext &&
0 0 if(mg->mg_type == PERL_MAGIC_ext &&
968 0 0 mg->mg_ptr && mg->mg_len != HEf_SVKEY) {
974 0 0 if(he)
975 0 0 helper = (DMD_MagicHelper *)SvUV(HeVAL(he));
977 0 0 if(helper) {
983 0 0 if(ret > 0)
986 0 0 FREETMPS;
993 262 58784 if(SvOBJECT(sv)) {
1040 0 0 if(!ctx->structdefs)
1044 0 0 if(!SvOK(idsv)) {
0 0 if(!SvOK(idsv)) {
0 0 if(!SvOK(idsv)) {
1054 0 0 for(size_t i = 0; i < nfields; i++) {
1067 0 0 write_svptr(fh, NUM2PTR(SV *, SvIV(idsv))); /* abuse the stash pointer to store the descriptor ID */
1070 0 0 for(size_t i = 0; i < nfields; i++)
1157 1 0 max_string = SvIV(get_sv("Devel::MAT::Dumper::MAX_STRING", GV_ADD));
1162 0 1 if(hv_iterinit(legacy_helper_per_package)) {
1164 0 0 while((he = hv_iternext(legacy_helper_per_package))) {
1166 0 0 warn(" %s\n", HePV(he, len)); // package names won't contain embedded NULs
0 0 warn(" %s\n", HePV(he, len)); // package names won't contain embedded NULs
1170 0 1 if(hv_iterinit(legacy_helper_per_magic)) {
1172 0 0 while((he = hv_iternext(legacy_helper_per_magic))) {
1174 0 0 warn(" %s\n", HePV(he, len)); // magic addresses are decimal integers
0 0 warn(" %s\n", HePV(he, len)); // magic addresses are decimal integers
1346 0 1 if(moreroots)
1347 0 0 nroots += (AvFILL(moreroots)+1) / 2;
1352 63 1 for(i = 0; i < sizeof(roots) / sizeof(roots[0]); i++) {
1356 0 1 if(moreroots) {
1358 0 0 int max = AvFILL(moreroots);
1360 0 0 for(i = 0; i < max; i += 2) {
1361 0 0 write_str(fh, SvPV_nolen(svp[i]));
1369 2 1 for(sp = PL_stack_base; sp <= PL_stack_sp; sp++)
1376 350 1 for(arena = PL_sv_arenaroot; arena; arena = (SV *)SvANY(arena)) {
1380 59150 350 for(sv = arena + 1; sv < arenaend; sv++) {
1381 0 59150 if(sv == tmpsv)
1384 104 59046 switch(SvTYPE(sv)) {
1391 1 59045 if(sv == (const SV *)PL_defstash)
1397 0 1 if(!seen_defstash)
1408 4592 1 while(saveix) {
1416 4591 1 if(type <= SAVEt_ARG0_MAX)
1418 0 4591 else if(type <= SAVEt_ARG1_MAX)
1420 0 0 else if(type <= SAVEt_ARG2_MAX)
1422 0 0 else if(type <= SAVEt_MAX)
1429 4591 1 ANY *a0 = count > 0 ? &PL_savestack[saveix ] : NULL,
1430 0 4592 *a1 = count > 1 ? &PL_savestack[saveix+1] : NULL,
1431 0 4592 *a2 = count > 2 ? &PL_savestack[saveix+2] : NULL;
1524 0 0 if(a1->any_ptr != (SV **) &(GvGP((GV *)a0->any_ptr)->gp_cv)) {
1538 0 0 if(a0->any_ptr == &GvSV(PL_defgv)) {
1562 0 1 if(!cx)
1572 0 0 write_str(fh, CopFILE(oldcop));
1588 0 0 if(CxOLD_OP_TYPE(cx) == OP_ENTEREVAL) {
1593 0 0 write_str(fh, CopFILE(oldcop));
1596 0 0 else if(cx->blk_eval.old_namesv)
1604 0 0 write_str(fh, CopFILE(oldcop));
1614 0 1 if(ctx.structdefs)
1625 0 1 if(!fh)
1638 0 2 if((svp = hv_fetchs(PL_modglobal, "Devel::MAT::Dumper/%helper_per_package", 0)))
1645 0 2 if((svp = hv_fetchs(PL_modglobal, "Devel::MAT::Dumper/%helper_per_magic", 0)))