Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | BOOL | - |
4 | _pcre16_xclass(int c, const pcre_uchar *data, BOOL utf) | - |
5 | { | - |
6 | int t; | - |
7 | BOOL negated = (*data & 0x01) != 0; | - |
8 | | - |
9 | (void)utf; | - |
10 | if (c < 256) evaluated: c < 256 yes Evaluation Count:26 | yes Evaluation Count:15 |
| 15-26 |
11 | { | - |
12 | if ((*data & 0x02) != 0 && partially evaluated: (*data & 0x02) != 0 no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
13 | (((pcre_uint8 *)(data + 1))[c/8] & (1 << (c&7))) != 0) never evaluated: (((pcre_uint8 *)(data + 1))[c/8] & (1 << (c&7))) != 0 | 0 |
14 | return !negated; never executed: return !negated; | 0 |
15 | } executed: } Execution Count:26 | 26 |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | if ((*data++ & 0x02) != 0) data += 32 / sizeof(pcre_uchar); never executed: data += 32 / sizeof(pcre_uchar); partially evaluated: (*data++ & 0x02) != 0 no Evaluation Count:0 | yes Evaluation Count:41 |
| 0-41 |
22 | | - |
23 | while ((t = *data++) != 0) evaluated: (t = *data++) != 0 yes Evaluation Count:41 | yes Evaluation Count:15 |
| 15-41 |
24 | { | - |
25 | int x, y; | - |
26 | if (t == 1) partially evaluated: t == 1 no Evaluation Count:0 | yes Evaluation Count:41 |
| 0-41 |
27 | { | - |
28 | | - |
29 | if (utf) | 0 |
30 | { | - |
31 | x = *data++; if ((x & 0xfc00) == 0xd800) { x = (((x & 0x3ff) << 10) | (*data++ & 0x3ff)) + 0x10000; };; never evaluated: (x & 0xfc00) == 0xd800 | 0 |
32 | } | 0 |
33 | else | - |
34 | | - |
35 | x = *data++; never executed: x = *data++; | 0 |
36 | if (c == x) return !negated; never executed: return !negated; | 0 |
37 | } | 0 |
38 | else if (t == 2) partially evaluated: t == 2 yes Evaluation Count:41 | no Evaluation Count:0 |
| 0-41 |
39 | { | - |
40 | | - |
41 | if (utf) partially evaluated: utf yes Evaluation Count:41 | no Evaluation Count:0 |
| 0-41 |
42 | { | - |
43 | x = *data++; if ((x & 0xfc00) == 0xd800) { x = (((x & 0x3ff) << 10) | (*data++ & 0x3ff)) + 0x10000; };; partially evaluated: (x & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:41 |
| 0-41 |
44 | y = *data++; if ((y & 0xfc00) == 0xd800) { y = (((y & 0x3ff) << 10) | (*data++ & 0x3ff)) + 0x10000; };; partially evaluated: (y & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:41 |
| 0-41 |
45 | } executed: } Execution Count:41 | 41 |
46 | else | - |
47 | | - |
48 | { | - |
49 | x = *data++; | - |
50 | y = *data++; | - |
51 | } | 0 |
52 | if (c >= x && c <= y) return !negated; executed: return !negated; Execution Count:26 partially evaluated: c >= x yes Evaluation Count:41 | no Evaluation Count:0 |
evaluated: c <= y yes Evaluation Count:26 | yes Evaluation Count:15 |
| 0-41 |
53 | } executed: } Execution Count:15 | 15 |
54 | | - |
55 | | - |
56 | else | - |
57 | { | - |
58 | const ucd_record *prop = (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128]); | - |
59 | | - |
60 | switch(*data) | - |
61 | { | - |
62 | case 0: | - |
63 | if (t == 3) return !negated; never executed: return !negated; | 0 |
64 | break; | 0 |
65 | | - |
66 | case 1: | - |
67 | if ((prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || never evaluated: prop->chartype == ucp_Lu never evaluated: prop->chartype == ucp_Ll | 0 |
68 | prop->chartype == ucp_Lt) == (t == 3)) return !negated; never executed: return !negated; never evaluated: (prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) == (t == 3) never evaluated: prop->chartype == ucp_Lt | 0 |
69 | break; | 0 |
70 | | - |
71 | case 2: | - |
72 | if ((data[1] == _pcre16_ucp_gentype[prop->chartype]) == (t == 3)) never evaluated: (data[1] == _pcre16_ucp_gentype[prop->chartype]) == (t == 3) | 0 |
73 | return !negated; never executed: return !negated; | 0 |
74 | break; | 0 |
75 | | - |
76 | case 3: | - |
77 | if ((data[1] == prop->chartype) == (t == 3)) return !negated; never executed: return !negated; never evaluated: (data[1] == prop->chartype) == (t == 3) | 0 |
78 | break; | 0 |
79 | | - |
80 | case 4: | - |
81 | if ((data[1] == prop->script) == (t == 3)) return !negated; never executed: return !negated; never evaluated: (data[1] == prop->script) == (t == 3) | 0 |
82 | break; | 0 |
83 | | - |
84 | case 5: | - |
85 | if ((_pcre16_ucp_gentype[prop->chartype] == ucp_L || never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L | 0 |
86 | _pcre16_ucp_gentype[prop->chartype] == ucp_N) == (t == 3)) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_L || _pcre16_ucp_gentype[prop->chartype] == ucp_N) == (t == 3) never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N | 0 |
87 | return !negated; never executed: return !negated; | 0 |
88 | break; | 0 |
89 | | - |
90 | case 6: | - |
91 | if ((_pcre16_ucp_gentype[prop->chartype] == ucp_Z || never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z | 0 |
92 | c == '\011' || c == '\012' || c == '\014' || c == '\015') never evaluated: c == '\011' never evaluated: c == '\012' never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
93 | == (t == 3)) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == (t == 3) | 0 |
94 | return !negated; never executed: return !negated; | 0 |
95 | break; | 0 |
96 | | - |
97 | case 7: | - |
98 | if ((_pcre16_ucp_gentype[prop->chartype] == ucp_Z || never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z | 0 |
99 | c == '\011' || c == '\012' || c == '\013' || never evaluated: c == '\011' never evaluated: c == '\012' never evaluated: c == '\013' | 0 |
100 | c == '\014' || c == '\015') == (t == 3)) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == (t == 3) never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
101 | return !negated; never executed: return !negated; | 0 |
102 | break; | 0 |
103 | | - |
104 | case 8: | - |
105 | if ((_pcre16_ucp_gentype[prop->chartype] == ucp_L || never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L | 0 |
106 | _pcre16_ucp_gentype[prop->chartype] == ucp_N || c == '\137') never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N never evaluated: c == '\137' | 0 |
107 | == (t == 3)) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_L || _pcre16_ucp_gentype[prop->chartype] == ucp_N || c == '\137') == (t == 3) | 0 |
108 | return !negated; never executed: return !negated; | 0 |
109 | break; | 0 |
110 | | - |
111 | | - |
112 | | - |
113 | | - |
114 | default: | - |
115 | return 0; never executed: return 0; | 0 |
116 | } | - |
117 | | - |
118 | data += 2; | - |
119 | } | 0 |
120 | | - |
121 | } | - |
122 | | - |
123 | return negated; executed: return negated; Execution Count:15 | 15 |
124 | } | - |
125 | | - |
| | |