Branch Coverage

lib/Devel/MAT/Dumper.xs
Criterion Covered Total %
branch 213 378 56.3


line true false branch
66 0 0 if(!tmpsv)
242 21683 12751 if(s)
286 53454 61984 if(o->op_flags & OPf_KIDS) {
287 59962 53411 for (kid = ((UNOP*)o)->op_first; kid; kid = OpSIBLING(kid)) {
113373 53454 for (kid = ((UNOP*)o)->op_first; kid; kid = OpSIBLING(kid)) {
292 0 115438 if(OP_CLASS(o) == OA_PMOP &&
617 114821 if(OP_CLASS(o) == OA_PMOP &&
583 34 if(OP_CLASS(o) == OA_PMOP &&
295 45 538 o->op_type != OP_SPLIT &&
311 262 58770 write_svptr(fh, SvOBJECT(sv) ? (SV*)SvSTASH(sv) : NULL);
316 5773 0 write_common_sv(fh, (const SV *)gv,
317 0 5773 sizeof(XPVGV) + (isGV_with_GP(gv) ? sizeof(struct gp) : 0));
319 5773 0 if(isGV_with_GP(gv)) {
5773 0 if(isGV_with_GP(gv)) {
330 5773 0 write_svptr(fh, (SV*)GvIO(gv));
5773 0 write_svptr(fh, (SV*)GvIO(gv));
5773 0 write_svptr(fh, (SV*)GvIO(gv));
335 5773 0 write_str(fh, GvFILE(gv));
360 4500 18081 switch(SvTYPE(sv)) {
369 17824 4757 if(SvPOK(sv))
371 0 22581 if(SvOOK(sv)) {
373 0 0 SvOOK_offset(sv, offset);
0 0 SvOOK_offset(sv, offset);
380 22575 6 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
22330 251 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
4757 17824 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
22553 28 write_u8(fh, (SvIOK(sv) ? 0x01 : 0) |
385 4753 17828 write_uint(fh, SvIOK(sv) ? SvUVX(sv) : 0);
386 251 22330 write_nv(fh, SvNOK(sv) ? SvNVX(sv) : 0.0);
387 17824 4757 write_uint(fh, SvPOK(sv) ? SvCUR(sv) : 0);
397 17824 4757 if(SvPOK(sv)) {
399 17824 0 if(max_string > -1 && len > max_string)
10 17814 if(max_string > -1 && len > max_string)
429 1 5178 int len = (av == PL_curstack) ? (PL_stack_sp - PL_stack_base + 1) :
441 35358 5179 for(i = 0; i < len; i++)
450 927 175 if(HvARRAY(hv)) {
452 29724 927 for(bucket = 0; bucket <= HvMAX(hv); bucket++) {
456 17217 29724 for(he = HvARRAY(hv)[bucket]; he; he = he->hent_next) {
460 5758 11459 if(!HvSHAREKEYS(hv))
479 27628 906 for(bucket = 0; bucket <= HvMAX(hv); bucket++) {
481 17217 27628 for(he = HvARRAY(hv)[bucket]; he; he = he->hent_next) {
483 0 17217 char *key = HePV(he, len);
0 0 char *key = HePV(he, len);
485 11459 5758 write_svptr(fh, is_strtab ? NULL : HeVAL(he));
498 66 796 if(SvOOK(hv) && HvAUX(hv))
66 0 if(SvOOK(hv) && HvAUX(hv))
504 687 175 if(HvARRAY(hv) && nkeys)
666 21 if(HvARRAY(hv) && nkeys)
512 65 175 int nkeys = write_hv_header(fh, stash,
520 240 0 if(SvOOK(stash) && HvAUX(stash))
240 0 if(SvOOK(stash) && HvAUX(stash))
524 175 65 if(mro_meta) {
547 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));
550 240 0 if(HvARRAY(stash))
557 2347 2242 PADLIST *pl = (is_xsub ? NULL : CvPADLIST(cv));
571 2347 2242 if(!CvISXSUB(cv) && !CvCONST(cv) && (start = CvSTART(cv))) {
2344 3 if(!CvISXSUB(cv) && !CvCONST(cv) && (start = CvSTART(cv))) {
2124 220 if(!CvISXSUB(cv) && !CvCONST(cv) && (start = CvSTART(cv))) {
572 2017 107 if(start->op_type == OP_NEXTSTATE)
576 4400 189 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
2347 2242 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
4490 99 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
4190 399 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
4589 0 write_u8(fh, (CvCLONE(cv) ? 0x01 : 0) |
590 2347 2242 if(!is_xsub && !CvCONST(cv))
2344 3 if(!is_xsub && !CvCONST(cv))
600 0 4589 if(CvNAMED(cv))
612 1590 2999 if(CvCONST(cv))
618 4483 106 if(CvFILE(cv))
624 0 4589 if(CvNAMED(cv))
631 1 4588 if(cv == PL_main_cv && PL_main_root)
1 0 if(cv == PL_main_cv && PL_main_root)
636 2346 2242 else if(!is_xsub && !CvCONST(cv) && CvROOT(cv))
2343 3 else if(!is_xsub && !CvCONST(cv) && CvROOT(cv))
2019 324 else if(!is_xsub && !CvCONST(cv) && CvROOT(cv))
640 2127 2462 if(pl) {
653 18555 2127 for(padix = 1; padix <= padix_max; padix++) {
655 559 17996 if(!pn)
663 3429 14567 if(PadnameFLAGS(pn)) {
678 2137 2127 for(depth = 1; depth <= PadlistMAX(pl); depth++) {
690 0 4589 FREETMPS;
724 0 0 while(p <= SP) {
725 0 0 unsigned char type = SvIV(p[0]);
726 0 0 switch(type) {
731 0 0 write_strn(fh, SvPV_nolen(p[3]), SvCUR(p[3])); /* annotation */
754 23135 2296 type = SvROK(sv) ? PMAT_SVtREF : PMAT_SVtSCALAR; break;
768 306 796 case SVt_PVHV: type = HvNAME(sv) ? PMAT_SVtSTASH : PMAT_SVtHASH; break;
240 66 case SVt_PVHV: type = HvNAME(sv) ? PMAT_SVtSTASH : PMAT_SVtHASH; break;
0 240 case SVt_PVHV: type = HvNAME(sv) ? PMAT_SVtSTASH : PMAT_SVtHASH; break;
0 0 case SVt_PVHV: type = HvNAME(sv) ? PMAT_SVtSTASH : PMAT_SVtHASH; break;
240 0 case SVt_PVHV: type = HvNAME(sv) ? PMAT_SVtSTASH : PMAT_SVtHASH; break;
0 240 case SVt_PVHV: type = HvNAME(sv) ? PMAT_SVtSTASH : PMAT_SVtHASH; break;
0 240 case SVt_PVHV: type = HvNAME(sv) ? PMAT_SVtSTASH : PMAT_SVtHASH; break;
777 23135 35897 if(type == PMAT_SVtSCALAR && !SvOK(sv))
554 22581 if(type == PMAT_SVtSCALAR && !SvOK(sv))
554 0 if(type == PMAT_SVtSCALAR && !SvOK(sv))
554 0 if(type == PMAT_SVtSCALAR && !SvOK(sv))
808 4831 54201 if(SvMAGICAL(sv)) {
810 4831 4831 for(mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
816 2 4829 if(mg->mg_len == HEf_SVKEY)
822 0 4831 if(mg->mg_type == PERL_MAGIC_ext &&
0 0 if(mg->mg_type == PERL_MAGIC_ext &&
823 0 0 mg->mg_ptr && mg->mg_len != HEf_SVKEY) {
829 0 0 if(he)
830 0 0 helper = (DMD_MagicHelper *)SvUV(HeVAL(he));
834 0 0 if(he)
835 0 0 legacy_helper = (DMD_LegacyMagicHelper *)SvUV(HeVAL(he));
837 0 0 if(helper || legacy_helper) {
842 0 0 if(helper)
847 0 0 if(ret > 0)
850 0 0 FREETMPS;
857 262 58770 if(SvOBJECT(sv)) {
862 262 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
262 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 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)))
262 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
262 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
262 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 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)))
262 0 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 if((svp = hv_fetch(helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
863 0 0 helper = (DMD_Helper *)SvUV(*svp);
866 262 0 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
262 0 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 0 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
262 0 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
262 0 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
262 0 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 0 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
262 0 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
0 262 if((svp = hv_fetch(legacy_helper_per_package, HvNAME(stash), HvNAMELEN(stash), 0)))
867 0 0 legacy_helper = (DMD_LegacyHelper *)SvUV(*svp);
869 0 262 if(helper || legacy_helper) {
874 0 0 if(helper)
879 0 0 if(ret > 0)
882 0 0 FREETMPS;
930 0 0 if(!ctx->structdefs)
934 0 0 if(!SvOK(idsv)) {
0 0 if(!SvOK(idsv)) {
0 0 if(!SvOK(idsv)) {
944 0 0 for(size_t i = 0; i < nfields; i++) {
957 0 0 write_svptr(fh, NUM2PTR(SV *, SvIV(idsv))); /* abuse the stash pointer to store the descriptor ID */
960 0 0 for(size_t i = 0; i < nfields; i++)
1047 1 0 max_string = SvIV(get_sv("Devel::MAT::Dumper::MAX_STRING", GV_ADD));
1212 0 1 if(moreroots)
1213 0 0 nroots += (AvFILL(moreroots)+1) / 2;
1218 63 1 for(i = 0; i < sizeof(roots) / sizeof(roots[0]); i++) {
1222 0 1 if(moreroots) {
1224 0 0 int max = AvFILL(moreroots);
1226 0 0 for(i = 0; i < max; i += 2) {
1227 0 0 write_str(fh, SvPV_nolen(svp[i]));
1235 2 1 for(sp = PL_stack_base; sp <= PL_stack_sp; sp++)
1242 350 1 for(arena = PL_sv_arenaroot; arena; arena = (SV *)SvANY(arena)) {
1246 59150 350 for(sv = arena + 1; sv < arenaend; sv++) {
1247 0 59150 if(sv == tmpsv)
1250 118 59032 switch(SvTYPE(sv)) {
1257 1 59031 if(sv == (const SV *)PL_defstash)
1263 0 1 if(!seen_defstash)
1274 4591 1 while(saveix) {
1282 4590 1 if(type <= SAVEt_ARG0_MAX)
1284 0 4590 else if(type <= SAVEt_ARG1_MAX)
1286 0 0 else if(type <= SAVEt_ARG2_MAX)
1288 0 0 else if(type <= SAVEt_MAX)
1295 4590 1 ANY *a0 = count > 0 ? &PL_savestack[saveix ] : NULL,
1296 0 4591 *a1 = count > 1 ? &PL_savestack[saveix+1] : NULL,
1297 0 4591 *a2 = count > 2 ? &PL_savestack[saveix+2] : NULL;
1390 0 0 if(a1->any_ptr != (SV **) &(GvGP((GV *)a0->any_ptr)->gp_cv)) {
1404 0 0 if(a0->any_ptr == &GvSV(PL_defgv)) {
1428 0 1 if(!cx)
1438 0 0 write_str(fh, CopFILE(oldcop));
1454 0 0 if(CxOLD_OP_TYPE(cx) == OP_ENTEREVAL) {
1459 0 0 write_str(fh, CopFILE(oldcop));
1462 0 0 else if(cx->blk_eval.old_namesv)
1470 0 0 write_str(fh, CopFILE(oldcop));
1480 0 1 if(ctx.structdefs)
1491 0 1 if(!fh)