hax/sv_regexp_match.c.inc

filter: Statementstmt 87.5% 7 / 8 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 75.0% 9 / 12 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« share/include/DataChecks.h ↑ Summary hax/ckcall_constfold.c.inc »
1 /* vi: set ft=c : */
2  
3 #define sv_regexp_match(sv, rx) S_sv_regexp_match(aTHX_ sv, rx)
4 4 static bool S_sv_regexp_match(pTHX_ SV *sv, REGEXP *rx)
5 {
6 STRLEN len;
7 /* These don't get modified, but CALLREGEXEC() doesn't take consts. */
8 4 char *strbeg = SvPV(sv, len);
9 4 char *strend = strbeg + len;
10  
11 4 STRLEN minlen = RX_MINLEN(rx);
12 4 ▶ if(minlen && len < minlen)
Branch: 2 branches
BranchTrueFalseTotal
if(minlen && len < minlen) 4 0 4
if(minlen && len < minlen) 0 4 4
13 /* string is already shorter than the shortest possible match */
14 0 return false;
15  
16 /* Entirely unclear from docs what data or flags should be but in practice
17 * it turns out that NULL/0 seems to work fine.
18 * minend can just be 1.
19 */
20 4 I32 ret = CALLREGEXEC(rx, strbeg, strend, strbeg, 1, sv, NULL, 0);
21 4 return (ret != 0);
22 }
« share/include/DataChecks.h ↑ Summary hax/ckcall_constfold.c.inc »