Branch Coverage

src/xs/next.cc
Criterion Covered Total %
branch 131 284 46.1


line true false branch
27 68 1 for (i = startingblock; i >= 0; --i) if (CxTYPE(cxstk+i) == CXt_SUB) return i;
62 6 for (i = startingblock; i >= 0; --i) if (CxTYPE(cxstk+i) == CXt_SUB) return i;
39 1 62 while (cxix < 0) {
40 1 0 if (top_si->si_type == PERLSI_MAIN) throw std::logic_error("next::method/next::can/maybe::next::method must be used in method context");
1 0 if (top_si->si_type == PERLSI_MAIN) throw std::logic_error("next::method/next::can/maybe::next::method must be used in method context");
46 62 0 if (PL_DBsub && GvCV(PL_DBsub)) {
0 62 if (PL_DBsub && GvCV(PL_DBsub)) {
47 0 0 if (ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub)) {
52 0 0 if (dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub)) {
0 0 if (dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub)) {
53 0 0 if (CxTYPE((PERL_CONTEXT*)(&ccstack[dbcxix])) != CXt_SUB) {
66 10 52 if (mg && (HV*)mg->mg_ptr == stash) {
10 0 if (mg && (HV*)mg->mg_ptr == stash) {
71 52 0 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
52 0 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
52 0 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
0 52 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
0 0 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
52 0 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
0 52 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
52 0 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
11 41 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
7 4 if (!stash || !HvNAME(stash) || (GvNAMELEN(gv) == 8 && !memcmp(GvNAME(gv), "__ANON__", 8))) { // ANON sub
82 55 0 STRLEN pkglen = HvNAMELEN(stash);
55 0 STRLEN pkglen = HvNAMELEN(stash);
0 55 STRLEN pkglen = HvNAMELEN(stash);
0 0 STRLEN pkglen = HvNAMELEN(stash);
55 0 STRLEN pkglen = HvNAMELEN(stash);
0 55 STRLEN pkglen = HvNAMELEN(stash);
85 55 0 memcpy(fqn, HvNAME(stash), pkglen);
55 0 memcpy(fqn, HvNAME(stash), pkglen);
0 55 memcpy(fqn, HvNAME(stash), pkglen);
0 0 memcpy(fqn, HvNAME(stash), pkglen);
55 0 memcpy(fqn, HvNAME(stash), pkglen);
0 55 memcpy(fqn, HvNAME(stash), pkglen);
90 55 0 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
55 0 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
0 55 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
0 0 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
55 0 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
0 55 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
0 55 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
33 22 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
0 33 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
55 0 return newSVpvn_share(fqn, (HvNAMEUTF8(stash) || GvNAMEUTF8(gv)) ? -(I32)fqnlen : (I32)fqnlen, 0);
94 2 0 std::string subname(GvNAME(context), GvNAMELEN(context));
95 2 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
2 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 2 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
2 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 2 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
2 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
2 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 2 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
2 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 2 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
2 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
96 2 0 throw std::logic_error(std::string("No next::method '") + subname + "' found for " + stashname);
2 0 throw std::logic_error(std::string("No next::method '") + subname + "' found for " + stashname);
2 0 throw std::logic_error(std::string("No next::method '") + subname + "' found for " + stashname);
2 0 throw std::logic_error(std::string("No next::method '") + subname + "' found for " + stashname);
2 0 throw std::logic_error(std::string("No next::method '") + subname + "' found for " + stashname);
100 129 10 if (!fqnsv) { // cache FQN SV with shared COW hash of current sub in magic to perform hash lookup with precomputed hash
103 74 55 if (!mg || (HV*)mg->mg_ptr != stash) {
0 74 if (!mg || (HV*)mg->mg_ptr != stash) {
104 0 55 if (mg) sv_unmagicext((SV*)context, PERL_MAGIC_ext, &c3_marker);
109 0 55 if (!had_magic) SvRMAGICAL_off(context);
114 138 1 struct mro_meta* selfmeta = HvMROMETA(selfstash);
116 119 20 if (nmcache) { // Use the cached coderef if it exists
118 80 39 if (he) {
120 69 11 return val == &PL_sv_undef ? NULL : (CV*)val;
130 59 0 char* stashname = HvNAME(stash);
59 0 char* stashname = HvNAME(stash);
0 59 char* stashname = HvNAME(stash);
0 0 char* stashname = HvNAME(stash);
59 0 char* stashname = HvNAME(stash);
0 59 char* stashname = HvNAME(stash);
131 59 0 STRLEN stashname_len = HvNAMELEN(stash);
59 0 STRLEN stashname_len = HvNAMELEN(stash);
0 59 STRLEN stashname_len = HvNAMELEN(stash);
0 0 STRLEN stashname_len = HvNAMELEN(stash);
59 0 STRLEN stashname_len = HvNAMELEN(stash);
0 59 STRLEN stashname_len = HvNAMELEN(stash);
140 89 1 while (entries--) {
143 86 3 if (SvCUR(linear_sv) == stashname_len && !memcmp(SvPVX(linear_sv), stashname, stashname_len)) break;
58 28 if (SvCUR(linear_sv) == stashname_len && !memcmp(SvPVX(linear_sv), stashname, stashname_len)) break;
147 57 2 if (entries > 0) {
148 86 8 while (entries--) {
153 0 86 if (!curstash) {
154 0 0 if (ckWARN(WARN_SYNTAX)) Perl_warner(aTHX_
0 0 if (ckWARN(WARN_SYNTAX)) Perl_warner(aTHX_
0 0 if (ckWARN(WARN_SYNTAX)) Perl_warner(aTHX_
156 0 0 (void*)linear_sv, HEKfARG( HvNAME_HEK(selfstash) )
161 29 57 GV** gvp = (GV**)hv_fetch(curstash, subname, subname_utf8 ? -(I32)subname_len : (I32)subname_len, 0);
162 37 49 if (!gvp) continue;
167 0 49 if (SvTYPE(candidate) != SVt_PVGV)
168 0 0 gv_init_pvn(candidate, curstash, subname, subname_len, GV_ADDMULTI|(subname_utf8 ? SVf_UTF8 : 0));
174 49 0 if (SvTYPE(candidate) == SVt_PVGV && (cand_cv = GvCV(candidate)) && !GvCVGEN(candidate)) {
49 0 if (SvTYPE(candidate) == SVt_PVGV && (cand_cv = GvCV(candidate)) && !GvCVGEN(candidate)) {
49 0 if (SvTYPE(candidate) == SVt_PVGV && (cand_cv = GvCV(candidate)) && !GvCVGEN(candidate)) {
49 0 if (SvTYPE(candidate) == SVt_PVGV && (cand_cv = GvCV(candidate)) && !GvCVGEN(candidate)) {
188 15 0 GV* context = _find_sub(aTHX_ &fqn);
189 15 0 return _method(aTHX_ selfstash, context, fqn);
194 40 1 GV* context = _find_sub(aTHX_ &fqn);
195 40 0 CV* ret = _method(aTHX_ selfstash, context, fqn);
196 2 38 if (!ret) _throw_no_next_method(selfstash, context);
0 2 if (!ret) _throw_no_next_method(selfstash, context);
204 0 0 if (!ret) _throw_no_next_method(selfstash, context);
210 312 0 if (HvMROMETA(selfstash)->mro_which->length != 3) return _method(aTHX_ selfstash, context, NULL); // C3
84 228 if (HvMROMETA(selfstash)->mro_which->length != 3) return _method(aTHX_ selfstash, context, NULL); // C3
214 228 0 HV* cache = HvSUPERCACHE(stash);
215 224 4 if (cache) {
217 218 6 if (he) {
219 218 0 if (isGV(gv) && (!GvCVGEN(gv) || GvCVGEN(gv) == (PL_sub_generation + HvMROMETA(stash)->cache_gen))) return GvCV(gv);
218 0 if (isGV(gv) && (!GvCVGEN(gv) || GvCVGEN(gv) == (PL_sub_generation + HvMROMETA(stash)->cache_gen))) return GvCV(gv);
218 0 if (isGV(gv) && (!GvCVGEN(gv) || GvCVGEN(gv) == (PL_sub_generation + HvMROMETA(stash)->cache_gen))) return GvCV(gv);
218 0 if (isGV(gv) && (!GvCVGEN(gv) || GvCVGEN(gv) == (PL_sub_generation + HvMROMETA(stash)->cache_gen))) return GvCV(gv);
218 0 if (isGV(gv) && (!GvCVGEN(gv) || GvCVGEN(gv) == (PL_sub_generation + HvMROMETA(stash)->cache_gen))) return GvCV(gv);
223 9 1 return ret ? (isGV(ret) ? GvCV(ret) : (CV*)ret) : NULL;
9 0 return ret ? (isGV(ret) ? GvCV(ret) : (CV*)ret) : NULL;
230 0 132 if (!ret) {
231 0 0 std::string subname(GvNAME(context), GvNAMELEN(context));
232 0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
0 0 std::string stashname(HvNAME(selfstash), HvNAMELEN(selfstash));
233 0 0 throw std::logic_error(std::string("No super::") + subname + " found for " + stashname);
0 0 throw std::logic_error(std::string("No super::") + subname + " found for " + stashname);
0 0 throw std::logic_error(std::string("No super::") + subname + " found for " + stashname);
0 0 throw std::logic_error(std::string("No super::") + subname + " found for " + stashname);
0 0 throw std::logic_error(std::string("No super::") + subname + " found for " + stashname);