| Line | Source Code | Coverage |
|---|
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | int | - |
| 7 | _pcre16_valid_utf(const pcre_uchar * string, int length, int *erroroffset) | - |
| 8 | { | - |
| 9 | | - |
| 10 | register const pcre_uchar * p; | - |
| 11 | register pcre_uchar c; | - |
| 12 | | - |
| 13 | if (length < 0) evaluated: length < 0| yes Evaluation Count:369 | yes Evaluation Count:333 |
| 333-369 |
| 14 | { | - |
| 15 | for (p = string; *p != 0; p++); executed: ;Execution Count:11293 evaluated: *p != 0| yes Evaluation Count:11293 | yes Evaluation Count:369 |
| 369-11293 |
| 16 | length = p - string; | - |
| 17 | } executed: }Execution Count:369 | 369 |
| 18 | | - |
| 19 | for (p = string; length-- > 0; p++) evaluated: length-- > 0| yes Evaluation Count:18081 | yes Evaluation Count:701 |
| 701-18081 |
| 20 | { | - |
| 21 | c = *p; | - |
| 22 | | - |
| 23 | if ((c & 0xf800) != 0xd800) evaluated: (c & 0xf800) != 0xd800| yes Evaluation Count:18073 | yes Evaluation Count:8 |
| 8-18073 |
| 24 | { | - |
| 25 | | - |
| 26 | | - |
| 27 | | - |
| 28 | | - |
| 29 | if (c == 0xfffe) partially evaluated: c == 0xfffe| no Evaluation Count:0 | yes Evaluation Count:18073 |
| 0-18073 |
| 30 | { | - |
| 31 | *erroroffset = p - string; | - |
| 32 | return 4; never executed: return 4; | 0 |
| 33 | } | - |
| 34 | } executed: }Execution Count:18073 | 18073 |
| 35 | else if ((c & 0x0400) == 0) partially evaluated: (c & 0x0400) == 0| yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
| 36 | { | - |
| 37 | | - |
| 38 | | - |
| 39 | | - |
| 40 | if (length == 0) partially evaluated: length == 0| no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
| 41 | { | - |
| 42 | *erroroffset = p - string; | - |
| 43 | return 1; never executed: return 1; | 0 |
| 44 | } | - |
| 45 | p++; | - |
| 46 | length--; | - |
| 47 | if ((*p & 0xfc00) != 0xdc00) evaluated: (*p & 0xfc00) != 0xdc00| yes Evaluation Count:1 | yes Evaluation Count:7 |
| 1-7 |
| 48 | { | - |
| 49 | *erroroffset = p - string; | - |
| 50 | return 2; executed: return 2;Execution Count:1 | 1 |
| 51 | } | - |
| 52 | } executed: }Execution Count:7 | 7 |
| 53 | else | - |
| 54 | { | - |
| 55 | | - |
| 56 | *erroroffset = p - string; | - |
| 57 | return 3; never executed: return 3; | 0 |
| 58 | } | - |
| 59 | } | - |
| 60 | | - |
| 61 | | - |
| 62 | | - |
| 63 | | - |
| 64 | | - |
| 65 | | - |
| 66 | return 0; executed: return 0;Execution Count:701 | 701 |
| 67 | } | - |
| 68 | | - |
| | |