line |
true |
false |
branch |
193
|
156 |
0 |
char *s = SvPV(sv, len); |
198
|
37 |
119 |
if (!strnEQ(s, "0000", 4)) { /* need to grow sv */ |
204
|
37 |
0 |
s = SvPV(sv, len); |
207
|
0 |
156 |
while (!*t) /* trailing '\0'? */ |
209
|
23884 |
156 |
while (t > s) { |
254
|
4980 |
1245 |
while (len--) |
|
19200 |
2400 |
while (len--) |
|
9944 |
1243 |
while (len--) |
|
4986 |
2493 |
while (len--) |
|
5008 |
2504 |
while (len--) |
|
10120 |
2530 |
while (len--) |
|
10056 |
1257 |
while (len--) |
|
10408 |
1301 |
while (len--) |
|
10004 |
2501 |
while (len--) |
|
9944 |
1243 |
while (len--) |
|
5120 |
1280 |
while (len--) |
|
9976 |
1247 |
while (len--) |
|
5028 |
1257 |
while (len--) |
|
9320 |
1165 |
while (len--) |
|
9352 |
1169 |
while (len--) |
|
11128 |
1391 |
while (len--) |
|
360 |
180 |
while (len--) |
|
354 |
177 |
while (len--) |
|
0 |
0 |
while (len--) |
|
712 |
178 |
while (len--) |
|
856 |
214 |
while (len--) |
|
776 |
97 |
while (len--) |
|
1160 |
145 |
while (len--) |
|
688 |
86 |
while (len--) |
|
384 |
96 |
while (len--) |
|
680 |
85 |
while (len--) |
|
480 |
120 |
while (len--) |
|
0 |
0 |
while (len--) |
|
16 |
2 |
while (len--) |
|
0 |
0 |
while (len--) |
|
72 |
9 |
while (len--) |
|
72 |
9 |
while (len--) |
|
356 |
89 |
while (len--) |
|
712 |
89 |
while (len--) |
|
696 |
87 |
while (len--) |
262
|
593 |
21 |
UV val = utf8n_to_uvchr((U8 *) *s, end-*s, &retlen, |
267
|
0 |
614 |
if (retlen == (STRLEN) -1 || retlen == 0) |
270
|
0 |
614 |
if (val >= 0x100) { |
291
|
0 |
312 |
const U32 flags = ckWARN(WARN_UTF8) ? |
295
|
4 |
308 |
if (UNLIKELY(needs_swap)) |
298
|
1105 |
312 |
for (;buf_len > 0; buf_len--) { |
299
|
1105 |
0 |
if (from >= end) return FALSE; |
301
|
0 |
1105 |
if (retlen == (STRLEN) -1 || retlen == 0) { |
305
|
0 |
1105 |
if (val >= 0x100) { |
309
|
12 |
1093 |
if (UNLIKELY(needs_swap)) |
315
|
0 |
312 |
if (bad) { |
316
|
0 |
0 |
if (bad & 1) { |
319
|
0 |
0 |
const int flags = ckWARN(WARN_UTF8) ? 0 : UTF8_ALLOW_ANY; |
320
|
0 |
0 |
for (ptr = *s; ptr < from; ptr += UTF8SKIP(ptr)) { |
321
|
0 |
0 |
if (ptr >= end) break; |
324
|
0 |
0 |
if (from > end) from = end; |
326
|
0 |
0 |
if ((bad & 2)) |
327
|
0 |
0 |
Perl_ck_warner(aTHX_ packWARN(datumtype & TYPE_IS_PACK ? |
|
0 |
0 |
Perl_ck_warner(aTHX_ packWARN(datumtype & TYPE_IS_PACK ? |
343
|
17 |
1 |
if (val >= 0x100 || !ISUUCHAR(val) || |
|
17 |
0 |
if (val >= 0x100 || !ISUUCHAR(val) || |
344
|
0 |
17 |
retlen == (STRLEN) -1 || retlen == 0) { |
357
|
8 |
300 |
if (UNLIKELY(needs_swap)) { |
359
|
24 |
8 |
while (p-- > start) { |
364
|
1129 |
300 |
while (start < end) { |
432
|
1 |
5 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
3 |
2 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
0 |
2 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
3 |
91 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
8 |
8 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
3 |
3 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
3 |
3 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
0 |
1 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
2 |
2 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
0 |
0 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
0 |
0 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
0 |
2 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
0 |
0 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
|
0 |
0 |
return (const char *)(( symptr->flags & FLAG_PACK ) ? "pack" : "unpack"); |
443
|
10990 |
7334 |
while (next_symbol(symptr)) { |
447
|
0 |
10990 |
switch (symptr->howlen) { |
459
|
7160 |
3830 |
if (!size) { |
497
|
13 |
716 |
if (!len) /* Avoid division by 0 */ |
503
|
0 |
1458 |
if (total < len) |
507
|
0 |
732 |
if (!len) /* Avoid division by 0 */ |
510
|
222 |
510 |
if (star) /* Other portable ways? */ |
552
|
148711 |
0 |
while (patptr < patend) { |
555
|
25811 |
122900 |
if (isSPACE(c)) |
557
|
41124 |
81776 |
else if (c == ender) |
559
|
0 |
81776 |
else if (c == '#') { |
560
|
0 |
0 |
while (patptr < patend && *patptr != '\n') |
|
0 |
0 |
while (patptr < patend && *patptr != '\n') |
563
|
13903 |
67873 |
} else if (c == '(') |
565
|
5052 |
62821 |
else if (c == '[') |
585
|
15838 |
709302 |
while (isDIGIT(*patptr)) { |
586
|
0 |
15838 |
if (len >= 0x7FFFFFFF/10) |
607
|
7962311 |
7135997 |
while (patptr < patend) { |
608
|
23120 |
7939191 |
if (isSPACE(*patptr)) |
610
|
12 |
7939179 |
else if (*patptr == '#') { |
612
|
184 |
0 |
while (patptr < patend && *patptr != '\n') |
|
172 |
12 |
while (patptr < patend && *patptr != '\n') |
614
|
12 |
0 |
if (patptr < patend) |
621
|
9 |
7939170 |
if (code == ','){ /* grandfather in commas but with a warning */ |
622
|
8 |
1 |
if (((symptr->flags & FLAG_COMMA) == 0) && ckWARN(WARN_UNPACK)){ |
|
6 |
2 |
if (((symptr->flags & FLAG_COMMA) == 0) && ckWARN(WARN_UNPACK)){ |
631
|
6878 |
7932292 |
if (code == '(') { |
632
|
6877 |
1 |
if( isDIGIT(*patptr) || *patptr == '*' || *patptr == '[' ) |
|
6874 |
3 |
if( isDIGIT(*patptr) || *patptr == '*' || *patptr == '[' ) |
|
1 |
6873 |
if( isDIGIT(*patptr) || *patptr == '*' || *patptr == '[' ) |
637
|
2 |
6871 |
if( symptr->level >= MAX_SUB_TEMPLATE_LEVEL ) |
643
|
304 |
7938859 |
if (TYPE_ENDIANNESS(symptr->flags)) { |
644
|
276 |
28 |
if (strchr(ENDIANNESS_ALLOWED_TYPES, TYPE_NO_MODIFIERS(code))) |
649
|
1376179 |
6591639 |
while (patptr < patend) { |
652
|
494429 |
881750 |
switch (*patptr) { |
671
|
28772 |
1347407 |
if (modifier == 0) |
674
|
0 |
28772 |
if (!strchr(allowed, TYPE_NO_MODIFIERS(code))) |
|
0 |
0 |
if (!strchr(allowed, TYPE_NO_MODIFIERS(code))) |
|
94 |
28678 |
if (!strchr(allowed, TYPE_NO_MODIFIERS(code))) |
678
|
16 |
28662 |
if (TYPE_ENDIANNESS(code | modifier) == TYPE_ENDIANNESS_MASK) |
681
|
6 |
28656 |
else if (TYPE_ENDIANNESS(code | modifier | inherited_modifiers) == |
686
|
6 |
28650 |
if ((code & modifier)) { |
701
|
1347407 |
6591639 |
if (patptr < patend) { |
702
|
698426 |
648981 |
if (isDIGIT(*patptr)) { |
706
|
154280 |
494701 |
} else if (*patptr == '*') { |
710
|
15296 |
479405 |
} else if (*patptr == '[') { |
715
|
10876 |
4420 |
if (isDIGIT(*lenptr)) { |
717
|
1 |
10875 |
if( *lenptr != ']' ) |
733
|
879260 |
544373 |
while (patptr < patend) { |
734
|
76215 |
803045 |
if (isSPACE(*patptr)) |
736
|
14 |
803031 |
else if (*patptr == '#') { |
738
|
148 |
8 |
while (patptr < patend && *patptr != '\n') |
|
142 |
6 |
while (patptr < patend && *patptr != '\n') |
740
|
6 |
8 |
if (patptr < patend) |
743
|
251 |
802780 |
if (*patptr == '/') { |
746
|
250 |
1 |
if (patptr < patend && |
|
249 |
1 |
if (patptr < patend && |
747
|
246 |
3 |
(isDIGIT(*patptr) || *patptr == '*' || *patptr == '[')) |
|
0 |
246 |
(isDIGIT(*patptr) || *patptr == '*' || *patptr == '[')) |
785
|
1036070 |
234186 |
while (pat < patend) { |
786
|
26 |
1036044 |
if (pat[0] == '#') { |
789
|
18 |
8 |
if (!pat) return FALSE; |
790
|
40253 |
995791 |
} else if (pat[0] == 'U') { |
791
|
12819 |
27434 |
if (first || pat[1] == '0') return TRUE; |
|
12813 |
6 |
if (first || pat[1] == '0') return TRUE; |
802
|
333090 |
2 |
while (pat < patend) { |
803
|
333082 |
8 |
if (pat[0] != '#') return pat[0]; |
806
|
8 |
0 |
if (!pat) return 0; |
840
|
261634 |
71450 |
if (flags & FLAG_DO_UTF8) flags |= FLAG_WAS_UTF8; |
841
|
27440 |
234194 |
else if (need_utf8(pat, patend)) { |
851
|
236741 |
96343 |
if (first_symbol(pat, patend) != 'U' && (flags & FLAG_DO_UTF8)) |
|
2547 |
234194 |
if (first_symbol(pat, patend) != 'U' && (flags & FLAG_DO_UTF8)) |
879
|
776401 |
333447 |
while (next_symbol(symptr)) { |
887
|
156936 |
619465 |
if ( unpack_only_one |
889
|
156930 |
6 |
&& (datumtype != '/') ) /* XXX can this be omitted */ |
892
|
103815 |
672580 |
switch (howlen = symptr->howlen) { |
907
|
481485 |
295087 |
if (props) { |
911
|
6429 |
475056 |
if (len > howmany) |
914
|
480066 |
1419 |
if (!checksum || (props & PACK_SIZE_CANNOT_CSUM)) { |
|
29 |
480037 |
if (!checksum || (props & PACK_SIZE_CANNOT_CSUM)) { |
915
|
407898 |
72168 |
if (len && unpack_only_one) len = 1; |
|
120935 |
286963 |
if (len && unpack_only_one) len = 1; |
917
|
31 |
480035 |
EXTEND_MORTAL(len); |
923
|
0 |
8 |
switch(TYPE_NO_ENDIANNESS(datumtype)) { |
928
|
185 |
1243 |
if (howlen == e_no_len) |
944
|
165 |
0 |
if (len && unpack_only_one) len = 1; |
|
31 |
134 |
if (len && unpack_only_one) len = 1; |
945
|
405 |
134 |
while (len--) { |
947
|
13 |
392 |
if (utf8) symptr->flags |= FLAG_PARSE_UTF8; |
950
|
54 |
345 |
if (s == strend && savsym.howlen == e_star) |
|
29 |
25 |
if (s == strend && savsym.howlen == e_star) |
962
|
12 |
23 |
const bool u8 = utf8 && !(datumtype & TYPE_IS_SHRIEKING); |
|
6 |
6 |
const bool u8 = utf8 && !(datumtype & TYPE_IS_SHRIEKING); |
963
|
30 |
5 |
if (howlen == e_star) from = strbeg; |
964
|
24 |
6 |
else if (len <= 0) from = s; |
968
|
10 |
24 |
while (--len && group) group = group->previous; |
|
10 |
0 |
while (--len && group) group = group->previous; |
969
|
24 |
0 |
from = group ? strbeg + group->strbeg : strbeg; |
972
|
30 |
5 |
newSVuv( u8 ? (UV) utf8_length((const U8*)from, (const U8*)s) : (UV) (s-from)) : |
|
5 |
25 |
newSVuv( u8 ? (UV) utf8_length((const U8*)from, (const U8*)s) : (UV) (s-from)) : |
973
|
1 |
4 |
newSViv(-(u8 ? (IV) utf8_length((const U8*)s, (const U8*)from) : (IV) (from-s))); |
974
|
0 |
35 |
mXPUSHs(sv); |
980
|
10 |
25 |
if (utf8 && !(datumtype & TYPE_IS_SHRIEKING)) |
|
9 |
1 |
if (utf8 && !(datumtype & TYPE_IS_SHRIEKING)) |
982
|
39 |
9 |
while (len > 0) { |
983
|
0 |
39 |
if (s >= strend) |
988
|
0 |
9 |
if (s > strend) |
991
|
0 |
26 |
if (strend-s < len) |
997
|
0 |
7 |
if (!len) /* Avoid division by 0 */ |
999
|
3 |
4 |
if (utf8) { |
1003
|
14 |
3 |
while (hop < s) { |
1005
|
2 |
12 |
if (--l == 0) { |
1010
|
0 |
3 |
if (last > s) |
1018
|
5 |
19 |
if (utf8) { |
1019
|
10 |
5 |
while (len > 0) { |
1020
|
0 |
10 |
if (s <= strbeg) |
1022
|
18 |
10 |
while (--s, UTF8_IS_CONTINUATION(*s)) { |
1023
|
0 |
18 |
if (s <= strbeg) |
1029
|
0 |
19 |
if (len > s - strbeg) |
1036
|
0 |
12 |
if (!len) /* Avoid division by 0 */ |
1038
|
2 |
10 |
if (utf8) ai32 = utf8_length((U8 *) strbeg, (U8 *) s) % len; |
1040
|
6 |
6 |
if (ai32 == 0) break; |
1045
|
76 |
4614 |
if (utf8) { |
1046
|
1082 |
76 |
while (len>0) { |
1047
|
0 |
1082 |
if (s >= strend) |
1053
|
0 |
4614 |
if (len > strend - s) |
1064
|
0 |
268037 |
if (checksum) { |
1066
|
0 |
0 |
if (len > strend - s) len = strend - s; |
1069
|
34 |
268003 |
if (utf8) { |
1072
|
83 |
19 |
for (l=len, hop=s; l>0; l--, hop += UTF8SKIP(hop)) { |
1073
|
15 |
68 |
if (hop >= strend) { |
1074
|
0 |
15 |
if (hop > strend) |
1079
|
0 |
34 |
if (hop > strend) |
1082
|
8 |
267995 |
} else if (len > strend - s) |
1085
|
23 |
268014 |
if (datumtype == 'Z') { |
1089
|
55 |
15 |
for (ptr = s; ptr < end; ptr++) if (*ptr == 0) break; |
|
70 |
8 |
for (ptr = s; ptr < end; ptr++) if (*ptr == 0) break; |
1091
|
6 |
17 |
if (howlen == e_star) /* exact for 'Z*' */ |
1092
|
0 |
6 |
len = ptr-s + (ptr != strend ? 1 : 0); |
1093
|
3717 |
264297 |
} else if (datumtype == 'A') { |
1096
|
7 |
3710 |
if (utf8 && (symptr->flags & FLAG_WAS_UTF8)) { |
|
6 |
1 |
if (utf8 && (symptr->flags & FLAG_WAS_UTF8)) { |
1097
|
28 |
2 |
for (ptr = s+len-1; ptr >= s; ptr--) |
1098
|
26 |
2 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
17 |
9 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
11 |
6 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
3 |
3 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
3 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
2 |
1 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
3 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
3 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
0 |
0 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
|
13 |
4 |
if (*ptr != 0 && !UTF8_IS_CONTINUATION(*ptr) && |
1099
|
0 |
0 |
!isSPACE_utf8(ptr)) break; |
|
0 |
0 |
!isSPACE_utf8(ptr)) break; |
1100
|
4 |
2 |
if (ptr >= s) ptr += UTF8SKIP(ptr); |
1102
|
0 |
6 |
if (ptr > s+len) |
1105
|
101227 |
915 |
for (ptr = s+len-1; ptr >= s; ptr--) |
1106
|
3362 |
97865 |
if (*ptr != 0 && !isSPACE(*ptr)) break; |
|
566 |
2796 |
if (*ptr != 0 && !isSPACE(*ptr)) break; |
1112
|
34 |
268003 |
if (utf8) { |
1115
|
10 |
24 |
if (!(symptr->flags & FLAG_WAS_UTF8)) |
1118
|
0 |
268037 |
mXPUSHs(sv); |
1124
|
95 |
6 |
if (howlen == e_star || len > (strend - s) * 8) |
|
0 |
95 |
if (howlen == e_star || len > (strend - s) * 8) |
1126
|
7 |
94 |
if (checksum) { |
1127
|
7 |
0 |
if (utf8) |
1128
|
0 |
0 |
while (len >= 8 && s < strend) { |
|
0 |
0 |
while (len >= 8 && s < strend) { |
1133
|
8257 |
7 |
while (len >= 8) { |
1137
|
3 |
4 |
if (len && s < strend) { |
|
3 |
0 |
if (len && s < strend) { |
1139
|
0 |
3 |
bits = SHIFT_BYTE(utf8, s, strend, datumtype); |
1140
|
1 |
2 |
if (datumtype == 'b') |
1141
|
7 |
2 |
while (len-- > 0) { |
1142
|
5 |
2 |
if (bits & 1) cuv++; |
1146
|
5 |
1 |
while (len-- > 0) { |
1147
|
1 |
4 |
if (bits & 0x80) cuv++; |
1154
|
94 |
0 |
sv = sv_2mortal(newSV(len ? len : 1)); |
1157
|
90 |
4 |
if (datumtype == 'b') { |
1160
|
66956 |
90 |
for (len = 0; len < ai32; len++) { |
1161
|
58584 |
8372 |
if (len & 7) bits >>= 1; |
1162
|
3 |
8369 |
else if (utf8) { |
1163
|
3 |
0 |
if (s >= strend) break; |
1166
|
51710 |
15246 |
*str++ = bits & 1 ? '1' : '0'; |
1171
|
75 |
4 |
for (len = 0; len < ai32; len++) { |
1172
|
64 |
11 |
if (len & 7) bits <<= 1; |
1173
|
3 |
8 |
else if (utf8) { |
1174
|
3 |
0 |
if (s >= strend) break; |
1177
|
12 |
63 |
*str++ = bits & 0x80 ? '1' : '0'; |
1182
|
0 |
94 |
XPUSHs(sv); |
1189
|
20320 |
197 |
if (howlen == e_star || len > (strend - s) * 2) |
|
0 |
20320 |
if (howlen == e_star || len > (strend - s) * 2) |
1191
|
20516 |
1 |
if (!checksum) { |
1192
|
20516 |
0 |
sv = sv_2mortal(newSV(len ? len : 1)); |
1196
|
53 |
20464 |
if (datumtype == 'h') { |
1199
|
214 |
53 |
for (len = 0; len < ai32; len++) { |
1200
|
106 |
108 |
if (len & 1) bits >>= 4; |
1201
|
3 |
105 |
else if (utf8) { |
1202
|
3 |
0 |
if (s >= strend) break; |
1205
|
214 |
0 |
if (!checksum) |
1211
|
41602 |
20464 |
for (len = 0; len < ai32; len++) { |
1212
|
20800 |
20802 |
if (len & 1) bits <<= 4; |
1213
|
596 |
20206 |
else if (utf8) { |
1214
|
596 |
0 |
if (s >= strend) break; |
1217
|
41580 |
22 |
if (!checksum) |
1221
|
20516 |
1 |
if (!checksum) { |
1224
|
0 |
20516 |
XPUSHs(sv); |
1229
|
205241 |
12868 |
if (len == 0) { |
1230
|
12866 |
2 |
if (explicit_length) |
1237
|
1706925 |
205393 |
while (len-- > 0 && s < strend) { |
|
1706923 |
2 |
while (len-- > 0 && s < strend) { |
1239
|
7074 |
1699849 |
if (utf8) |
1242
|
5556 |
1518 |
aint = utf8n_to_uvchr((U8 *) s, strend-s, &retlen, |
1244
|
0 |
7074 |
if (retlen == (STRLEN) -1 || retlen == 0) |
1250
|
55 |
1706868 |
if (aint >= 128 && datumtype != 'C') /* fake up signed chars */ |
1252
|
1488070 |
218853 |
if (!checksum) |
1254
|
10 |
218843 |
else if (checksum > bits_in_uv) |
1262
|
75 |
60 |
if (utf8) { |
1263
|
210 |
60 |
while (len-- > 0 && s < strend) { |
|
195 |
15 |
while (len-- > 0 && s < strend) { |
1265
|
0 |
195 |
const UV val = utf8n_to_uvchr((U8 *) s, strend-s, &retlen, |
1267
|
0 |
195 |
if (retlen == (STRLEN) -1 || retlen == 0) |
1270
|
60 |
135 |
if (!checksum) |
1272
|
9 |
126 |
else if (checksum > bits_in_uv) |
1277
|
60 |
0 |
} else if (!checksum) |
1278
|
61 |
60 |
while (len-- > 0) { |
1282
|
0 |
0 |
else if (checksum > bits_in_uv) |
1283
|
0 |
0 |
while (len-- > 0) cdouble += (NV) *(U8 *) s++; |
1285
|
0 |
0 |
while (len-- > 0) cuv += *(U8 *) s++; |
1288
|
59293 |
62361 |
if (len == 0) { |
1289
|
59291 |
2 |
if (explicit_length && howlen != e_star) { |
|
50931 |
8360 |
if (explicit_length && howlen != e_star) { |
1291
|
0 |
50931 |
if (symptr->flags & FLAG_DO_UTF8) utf8 = 0; |
1298
|
0 |
62361 |
if (len > strend - s) len = strend - s; |
1299
|
62353 |
8 |
if (!checksum) { |
|
0 |
62353 |
if (!checksum) { |
1300
|
62353 |
0 |
if (len && unpack_only_one) len = 1; |
|
12759 |
49594 |
if (len && unpack_only_one) len = 1; |
1302
|
0 |
62353 |
EXTEND_MORTAL(len); |
1304
|
2217915 |
25731 |
while (len-- > 0 && s < strend) { |
|
2181285 |
36630 |
while (len-- > 0 && s < strend) { |
1307
|
19 |
2181266 |
if (utf8) { |
1313
|
19 |
0 |
if (!uni_to_bytes(aTHX_ &ptr, strend, (char *) result, 1, |
1317
|
19 |
0 |
if (!uni_to_bytes(aTHX_ &ptr, strend, |
1319
|
0 |
19 |
auv = utf8n_to_uvchr(result, len, &retlen, UTF8_ALLOW_DEFAULT); |
1322
|
1796964 |
384302 |
auv = utf8n_to_uvchr((U8*)s, strend - s, &retlen, UTF8_ALLOW_DEFAULT); |
1323
|
0 |
2181266 |
if (retlen == (STRLEN) -1 || retlen == 0) |
1327
|
2181265 |
20 |
if (!checksum) |
1329
|
2 |
18 |
else if (checksum > bits_in_uv) |
1352
|
1360684 |
5508 |
while (len-- > 0) { |
1358
|
4 |
1360680 |
SHIFT16(utf8, s, strend, &ai16, datumtype, needs_swap); |
|
4 |
0 |
SHIFT16(utf8, s, strend, &ai16, datumtype, needs_swap); |
|
180 |
1360500 |
SHIFT16(utf8, s, strend, &ai16, datumtype, needs_swap); |
1363
|
1360216 |
468 |
if (!checksum) |
1365
|
30 |
438 |
else if (checksum > bits_in_uv) |
1391
|
386694 |
51748 |
while (len-- > 0) { |
1396
|
6 |
386688 |
SHIFT16(utf8, s, strend, &au16, datumtype, needs_swap); |
|
6 |
0 |
SHIFT16(utf8, s, strend, &au16, datumtype, needs_swap); |
|
177 |
386511 |
SHIFT16(utf8, s, strend, &au16, datumtype, needs_swap); |
1397
|
339527 |
47167 |
if (datumtype == 'n') |
1398
|
0 |
339527 |
au16 = PerlSock_ntohs(au16); |
1399
|
46480 |
340214 |
if (datumtype == 'v') |
1401
|
58360 |
328334 |
if (!checksum) |
1403
|
40 |
328294 |
else if (checksum > bits_in_uv) |
1411
|
164 |
44 |
while (len-- > 0) { |
1416
|
2 |
162 |
SHIFT16(utf8, s, strend, &ai16, datumtype, needs_swap); |
|
2 |
0 |
SHIFT16(utf8, s, strend, &ai16, datumtype, needs_swap); |
|
0 |
162 |
SHIFT16(utf8, s, strend, &ai16, datumtype, needs_swap); |
1419
|
82 |
82 |
if (datumtype == ('n' | TYPE_IS_SHRIEKING)) |
1420
|
0 |
82 |
ai16 = (I16) PerlSock_ntohs((U16) ai16); |
1421
|
82 |
82 |
if (datumtype == ('v' | TYPE_IS_SHRIEKING)) |
1423
|
14 |
150 |
if (!checksum) |
1425
|
10 |
140 |
else if (checksum > bits_in_uv) |
1433
|
657 |
210 |
while (len-- > 0) { |
1435
|
2 |
655 |
SHIFT_VAR(utf8, s, strend, aint, datumtype, needs_swap); |
|
2 |
0 |
SHIFT_VAR(utf8, s, strend, aint, datumtype, needs_swap); |
|
178 |
477 |
SHIFT_VAR(utf8, s, strend, aint, datumtype, needs_swap); |
1436
|
109 |
548 |
if (!checksum) |
1438
|
30 |
518 |
else if (checksum > bits_in_uv) |
1446
|
648 |
207 |
while (len-- > 0) { |
1448
|
2 |
646 |
SHIFT_VAR(utf8, s, strend, auint, datumtype, needs_swap); |
|
2 |
0 |
SHIFT_VAR(utf8, s, strend, auint, datumtype, needs_swap); |
|
214 |
432 |
SHIFT_VAR(utf8, s, strend, auint, datumtype, needs_swap); |
1449
|
180 |
468 |
if (!checksum) |
1451
|
30 |
438 |
else if (checksum > bits_in_uv) |
1458
|
311 |
101 |
while (len-- > 0) { |
1460
|
1 |
310 |
SHIFT_VAR(utf8, s, strend, aiv, datumtype, needs_swap); |
|
1 |
0 |
SHIFT_VAR(utf8, s, strend, aiv, datumtype, needs_swap); |
|
97 |
213 |
SHIFT_VAR(utf8, s, strend, aiv, datumtype, needs_swap); |
1461
|
68 |
243 |
if (!checksum) |
1463
|
15 |
228 |
else if (checksum > bits_in_uv) |
1470
|
410 |
152 |
while (len-- > 0) { |
1472
|
1 |
409 |
SHIFT_VAR(utf8, s, strend, auv, datumtype, needs_swap); |
|
1 |
0 |
SHIFT_VAR(utf8, s, strend, auv, datumtype, needs_swap); |
|
145 |
264 |
SHIFT_VAR(utf8, s, strend, auv, datumtype, needs_swap); |
1473
|
167 |
243 |
if (!checksum) |
1475
|
15 |
228 |
else if (checksum > bits_in_uv) |
1483
|
259 |
79 |
while (len-- > 0) { |
1485
|
1 |
258 |
SHIFT_VAR(utf8, s, strend, along, datumtype, needs_swap); |
|
1 |
0 |
SHIFT_VAR(utf8, s, strend, along, datumtype, needs_swap); |
|
86 |
172 |
SHIFT_VAR(utf8, s, strend, along, datumtype, needs_swap); |
1486
|
34 |
225 |
if (!checksum) |
1488
|
15 |
210 |
else if (checksum > bits_in_uv) |
1498
|
315 |
114 |
while (len-- > 0) { |
1503
|
3 |
312 |
SHIFT32(utf8, s, strend, &ai32, datumtype, needs_swap); |
|
3 |
0 |
SHIFT32(utf8, s, strend, &ai32, datumtype, needs_swap); |
|
96 |
216 |
SHIFT32(utf8, s, strend, &ai32, datumtype, needs_swap); |
1507
|
72 |
243 |
if (!checksum) |
1509
|
15 |
228 |
else if (checksum > bits_in_uv) |
1517
|
258 |
78 |
while (len-- > 0) { |
1519
|
1 |
257 |
SHIFT_VAR(utf8, s, strend, aulong, datumtype, needs_swap); |
|
1 |
0 |
SHIFT_VAR(utf8, s, strend, aulong, datumtype, needs_swap); |
|
85 |
172 |
SHIFT_VAR(utf8, s, strend, aulong, datumtype, needs_swap); |
1520
|
33 |
225 |
if (!checksum) |
1522
|
15 |
210 |
else if (checksum > bits_in_uv) |
1534
|
96288 |
82710 |
while (len-- > 0) { |
1539
|
221 |
96067 |
SHIFT32(utf8, s, strend, &au32, datumtype, needs_swap); |
|
221 |
0 |
SHIFT32(utf8, s, strend, &au32, datumtype, needs_swap); |
|
120 |
95947 |
SHIFT32(utf8, s, strend, &au32, datumtype, needs_swap); |
1540
|
19156 |
77132 |
if (datumtype == 'N') |
1541
|
0 |
19156 |
au32 = PerlSock_ntohl(au32); |
1542
|
76732 |
19556 |
if (datumtype == 'V') |
1544
|
95859 |
429 |
if (!checksum) |
1546
|
25 |
404 |
else if (checksum > bits_in_uv) |
1554
|
164 |
44 |
while (len-- > 0) { |
1559
|
2 |
162 |
SHIFT32(utf8, s, strend, &ai32, datumtype, needs_swap); |
|
2 |
0 |
SHIFT32(utf8, s, strend, &ai32, datumtype, needs_swap); |
|
0 |
162 |
SHIFT32(utf8, s, strend, &ai32, datumtype, needs_swap); |
1562
|
82 |
82 |
if (datumtype == ('N' | TYPE_IS_SHRIEKING)) |
1563
|
0 |
82 |
ai32 = (I32)PerlSock_ntohl((U32)ai32); |
1564
|
82 |
82 |
if (datumtype == ('V' | TYPE_IS_SHRIEKING)) |
1566
|
14 |
150 |
if (!checksum) |
1568
|
10 |
140 |
else if (checksum > bits_in_uv) |
1575
|
8 |
8 |
while (len-- > 0) { |
1577
|
1 |
7 |
SHIFT_VAR(utf8, s, strend, aptr, datumtype, needs_swap); |
|
1 |
0 |
SHIFT_VAR(utf8, s, strend, aptr, datumtype, needs_swap); |
|
2 |
5 |
SHIFT_VAR(utf8, s, strend, aptr, datumtype, needs_swap); |
1587
|
152 |
20 |
while (len > 0 && s < strend) { |
|
148 |
4 |
while (len > 0 && s < strend) { |
1589
|
8 |
140 |
ch = SHIFT_BYTE(utf8, s, strend, datumtype); |
1592
|
30 |
118 |
if (ch < 0x80) { |
1599
|
8 |
110 |
if (++bytes >= sizeof(UV)) { /* promote to string */ |
1603
|
156 |
0 |
while (s < strend) { |
1604
|
1 |
155 |
ch = SHIFT_BYTE(utf8, s, strend, datumtype); |
1606
|
148 |
8 |
if (!(ch & 0x80)) { |
1611
|
8 |
0 |
t = SvPV_nolen_const(sv); |
1612
|
72 |
8 |
while (*t == '0') |
1620
|
3 |
21 |
if ((s >= strend) && bytes) |
1625
|
1 |
8 |
if (symptr->howlen == e_star) |
1628
|
8 |
0 |
if (s + sizeof(char*) <= strend) { |
1630
|
1 |
7 |
SHIFT_VAR(utf8, s, strend, aptr, datumtype, needs_swap); |
|
1 |
0 |
SHIFT_VAR(utf8, s, strend, aptr, datumtype, needs_swap); |
|
0 |
7 |
SHIFT_VAR(utf8, s, strend, aptr, datumtype, needs_swap); |
1637
|
140 |
59 |
while (len-- > 0) { |
1639
|
2 |
138 |
SHIFT_VAR(utf8, s, strend, aquad, datumtype, needs_swap); |
|
2 |
0 |
SHIFT_VAR(utf8, s, strend, aquad, datumtype, needs_swap); |
|
9 |
129 |
SHIFT_VAR(utf8, s, strend, aquad, datumtype, needs_swap); |
1640
|
47 |
93 |
if (!checksum) |
1643
|
5 |
88 |
else if (checksum > bits_in_uv) |
1650
|
139 |
58 |
while (len-- > 0) { |
1652
|
2 |
137 |
SHIFT_VAR(utf8, s, strend, auquad, datumtype, needs_swap); |
|
2 |
0 |
SHIFT_VAR(utf8, s, strend, auquad, datumtype, needs_swap); |
|
9 |
128 |
SHIFT_VAR(utf8, s, strend, auquad, datumtype, needs_swap); |
1653
|
46 |
93 |
if (!checksum) |
1656
|
5 |
88 |
else if (checksum > bits_in_uv) |
1665
|
297 |
96 |
while (len-- > 0) { |
1667
|
1 |
296 |
SHIFT_VAR(utf8, s, strend, afloat, datumtype, needs_swap); |
|
1 |
0 |
SHIFT_VAR(utf8, s, strend, afloat, datumtype, needs_swap); |
|
89 |
207 |
SHIFT_VAR(utf8, s, strend, afloat, datumtype, needs_swap); |
1668
|
54 |
243 |
if (!checksum) |
1675
|
301 |
100 |
while (len-- > 0) { |
1677
|
1 |
300 |
SHIFT_VAR(utf8, s, strend, adouble, datumtype, needs_swap); |
|
1 |
0 |
SHIFT_VAR(utf8, s, strend, adouble, datumtype, needs_swap); |
|
89 |
211 |
SHIFT_VAR(utf8, s, strend, adouble, datumtype, needs_swap); |
1678
|
58 |
243 |
if (!checksum) |
1685
|
291 |
93 |
while (len-- > 0) { |
1687
|
1 |
290 |
SHIFT_BYTES(utf8, s, strend, anv.bytes, sizeof(anv.bytes), |
|
1 |
0 |
SHIFT_BYTES(utf8, s, strend, anv.bytes, sizeof(anv.bytes), |
|
87 |
203 |
SHIFT_BYTES(utf8, s, strend, anv.bytes, sizeof(anv.bytes), |
1689
|
48 |
243 |
if (!checksum) |
1709
|
34 |
1 |
if (!checksum) { |
1712
|
34 |
0 |
if (l) SvPOK_on(sv); |
1714
|
34 |
1 |
if (utf8) { |
1715
|
1 |
1 |
while (next_uni_uu(aTHX_ &s, strend, &len)) { |
1719
|
4 |
1 |
while (len > 0) { |
1727
|
4 |
0 |
if (!checksum) |
1731
|
1 |
0 |
if (s < strend) { |
1732
|
1 |
0 |
if (*s == '\n') { |
1738
|
0 |
0 |
if (skip < strend && *skip == '\n') |
|
0 |
0 |
if (skip < strend && *skip == '\n') |
1744
|
99 |
19 |
while (s < strend && *s > ' ' && ISUUCHAR(*s)) { |
|
84 |
15 |
while (s < strend && *s > ' ' && ISUUCHAR(*s)) { |
|
84 |
0 |
while (s < strend && *s > ' ' && ISUUCHAR(*s)) { |
1749
|
1000 |
84 |
while (len > 0) { |
1750
|
1000 |
0 |
if (s < strend && ISUUCHAR(*s)) |
|
999 |
1 |
if (s < strend && ISUUCHAR(*s)) |
1754
|
1000 |
0 |
if (s < strend && ISUUCHAR(*s)) |
|
999 |
1 |
if (s < strend && ISUUCHAR(*s)) |
1758
|
1000 |
0 |
if (s < strend && ISUUCHAR(*s)) |
|
999 |
1 |
if (s < strend && ISUUCHAR(*s)) |
1762
|
1000 |
0 |
if (s < strend && ISUUCHAR(*s)) |
|
999 |
1 |
if (s < strend && ISUUCHAR(*s)) |
1769
|
999 |
1 |
if (!checksum) |
1773
|
82 |
2 |
if (*s == '\n') |
1776
|
0 |
2 |
if (s + 1 < strend && s[1] == '\n') |
|
0 |
0 |
if (s + 1 < strend && s[1] == '\n') |
1780
|
34 |
1 |
if (!checksum) |
1781
|
0 |
34 |
XPUSHs(sv); |
1785
|
1428 |
773704 |
if (checksum) { |
1786
|
1275 |
153 |
if (strchr("fFdD", TYPE_NO_MODIFIERS(datumtype)) || |
|
57 |
1218 |
if (strchr("fFdD", TYPE_NO_MODIFIERS(datumtype)) || |
1787
|
57 |
0 |
(checksum > bits_in_uv && |
1792
|
479 |
210 |
while (checksum >= 16) { |
1796
|
26 |
210 |
while (cdouble < 0.0) |
1802
|
1163 |
55 |
if (checksum < bits_in_uv) { |
1808
|
0 |
1428 |
mXPUSHs(sv); |
1812
|
182 |
774950 |
if (symptr->flags & FLAG_SLASH){ |
1813
|
180 |
2 |
if (SP - PL_stack_base - start_sp_offset <= 0) |
1815
|
179 |
1 |
if( next_symbol(symptr) ){ |
1816
|
0 |
179 |
if( symptr->howlen == e_number ) |
1818
|
2 |
177 |
if( beyond ){ |
1823
|
155 |
22 |
len = POPi; |
1824
|
0 |
177 |
if( len < 0 ) |
1836
|
399 |
333056 |
if (new_s) |
1847
|
332951 |
133 |
I32 gimme = GIMME_V; |
1850
|
333083 |
1 |
const char *pat = SvPV_const(left, llen); |
1851
|
306598 |
26486 |
const char *s = SvPV_const(right, rlen); |
1857
|
190268 |
142816 |
cnt = unpackstring(pat, patend, s, strend, |
|
71460 |
261624 |
cnt = unpackstring(pat, patend, s, strend, |
|
10 |
71450 |
cnt = unpackstring(pat, patend, s, strend, |
1862
|
5 |
333051 |
if ( !cnt && gimme == G_SCALAR ) |
1871
|
278 |
59 |
while (len > 2) { |
1879
|
37 |
22 |
if (len > 0) { |
1880
|
13 |
24 |
const char r = (len > 1 ? s[1] : '\0'); |
1894
|
3 |
0 |
char *const result_c = SvPV_nolen(result); /* convenience */ |
1901
|
76 |
1 |
while (*s) { |
1906
|
0 |
0 |
if (!skip) { |
1922
|
74 |
0 |
if (!ignore) { |
1945
|
15 |
0 |
char * const s = SvPV(pnum, len); |
1952
|
480 |
15 |
while (*t) { |
1956
|
200 |
280 |
if (r) { |
1986
|
0 |
6777769 |
SvPV_force_nolen(cat); |
1987
|
0 |
6777769 |
if (DO_UTF8(cat)) |
|
0 |
0 |
if (DO_UTF8(cat)) |
2001
|
125451 |
0 |
if (SvUTF8(sv)) return; |
2005
|
97 |
125433 |
for (from_ptr = from_start; from_ptr < from_end; from_ptr++) |
2006
|
79 |
18 |
if (!NATIVE_IS_INVARIANT(*from_ptr)) break; |
2007
|
125433 |
18 |
if (from_ptr == from_end) { |
2018
|
0 |
18 |
Newx(marks, sym_ptr->level+2, const char *); |
2019
|
24 |
18 |
for (group=sym_ptr; group; group = group->previous) |
2022
|
15 |
18 |
for (m = marks; *m < from_ptr; m++) |
2025
|
39 |
18 |
for (;from_ptr < from_end; from_ptr++) { |
2026
|
9 |
39 |
while (*m == from_ptr) *m++ = to_ptr; |
2031
|
0 |
18 |
while (*m == from_ptr) *m++ = to_ptr; |
2032
|
18 |
0 |
if (m != marks + sym_ptr->level+1) { |
2038
|
24 |
18 |
for (group=sym_ptr; group; group = group->previous) |
2042
|
0 |
18 |
if (SvOOK(sv)) { |
2043
|
0 |
0 |
if (SvIVX(sv)) { |
2050
|
18 |
0 |
if (SvLEN(sv) != 0) |
2070
|
0 |
298 |
if (len - cur > needed) return SvPVX(sv); |
2072
|
298 |
0 |
return SvGROW(sv, len+extend+1); |
|
298 |
0 |
return SvGROW(sv, len+extend+1); |
2088
|
6777673 |
17563 |
if (symptr->level == 0 && found && symptr->code == 'U') { |
|
6777670 |
3 |
if (symptr->level == 0 && found && symptr->code == 'U') { |
|
123761 |
6653909 |
if (symptr->level == 0 && found && symptr->code == 'U') { |
2095
|
7151461 |
6794981 |
while (found) { |
2108
|
50383 |
7101078 |
switch (howlen) { |
2111
|
50383 |
0 |
0 : items; |
2119
|
7119641 |
31820 |
if (len) { |
2122
|
7105154 |
14487 |
if (props && !(props & PACK_SIZE_UNPREDICTABLE)) { |
|
6975288 |
129866 |
if (props && !(props & PACK_SIZE_UNPREDICTABLE)) { |
2125
|
109 |
6975179 |
GROWING(utf8, cat, start, cur, (STRLEN) len * size); |
|
55 |
6975233 |
GROWING(utf8, cat, start, cur, (STRLEN) len * size); |
2132
|
63 |
7151385 |
if (symptr->flags & FLAG_SLASH) { |
2134
|
0 |
63 |
if (!found) Perl_croak(aTHX_ "Code missing after '/' in pack"); |
2135
|
57 |
6 |
if (strchr("aAZ", lookahead.code)) { |
2136
|
6 |
51 |
if (lookahead.howlen == e_number) count = lookahead.length; |
2138
|
50 |
1 |
if (items > 0) { |
2142
|
7 |
44 |
if (lookahead.code == 'Z') count++; |
2145
|
4 |
2 |
if (lookahead.howlen == e_number && lookahead.length < items) |
|
2 |
2 |
if (lookahead.howlen == e_number && lookahead.length < items) |
2169
|
24 |
3 |
if (howlen == e_star) from = start; |
2170
|
21 |
3 |
else if (len == 0) from = cur; |
2174
|
3 |
21 |
while (--len && group) group = group->previous; |
|
3 |
0 |
while (--len && group) group = group->previous; |
2175
|
21 |
0 |
from = group ? start + group->strbeg : start; |
2177
|
27 |
0 |
fromstr = NEXTFROM; |
|
27 |
0 |
fromstr = NEXTFROM; |
2178
|
27 |
0 |
len = SvIV(fromstr); |
2184
|
19 |
33 |
if (utf8 && !(datumtype & TYPE_IS_SHRIEKING)) |
|
15 |
4 |
if (utf8 && !(datumtype & TYPE_IS_SHRIEKING)) |
2185
|
13 |
2 |
if (len >= 0) { |
2186
|
51 |
13 |
while (len && from < cur) { |
2190
|
0 |
13 |
if (from > cur) |
2192
|
11 |
2 |
if (len) { |
2195
|
10 |
2059 |
GROWING(0, cat, start, cur, len); |
2198
|
1 |
1 |
} else if (from < cur) { |
2209
|
15 |
22 |
if (len > 0) goto grow; |
2210
|
14 |
8 |
if (len == 0) goto no_change; |
2223
|
17568 |
3578 |
while (len--) { |
2225
|
204 |
17364 |
if (utf8) symptr->flags |= FLAG_PARSE_UTF8; |
2230
|
59 |
17303 |
if (SvUTF8(cat) != was_utf8) |
2234
|
17358 |
4 |
if (savsym.howlen == e_star && beglist == endlist) |
2242
|
13 |
721 |
if (!len) /* Avoid division by 0 */ |
2244
|
11 |
723 |
if (utf8) { |
2248
|
170 |
11 |
while (hop < cur) { |
2250
|
20 |
150 |
if (--l == 0) { |
2255
|
0 |
11 |
if (last > cur) |
2263
|
11 |
1448 |
if (utf8) { |
2264
|
10 |
1 |
if (len < 1) goto no_change; |
2266
|
88 |
12 |
while (len > 0) { |
2267
|
0 |
88 |
if (cur <= start) |
2270
|
169 |
88 |
while (--cur, UTF8_IS_CONTINUATION(*cur)) { |
2271
|
0 |
169 |
if (cur <= start) |
2279
|
1 |
1462 |
if (cur - start < len) |
2284
|
10 |
1464 |
if (cur < start+symptr->strbeg) { |
2288
|
20 |
0 |
for (group = symptr; |
2289
|
10 |
10 |
group && length < group->strbeg; |
2296
|
0 |
739 |
if (!len) /* Avoid division by 0 */ |
2298
|
11 |
728 |
if (utf8) ai32 = utf8_length((U8 *) start, (U8 *) cur) % len; |
2300
|
223 |
516 |
if (ai32 == 0) goto no_change; |
2311
|
4527 |
20 |
fromstr = NEXTFROM; |
|
4526 |
1 |
fromstr = NEXTFROM; |
2312
|
4324 |
223 |
aptr = SvPV_const(fromstr, fromlen); |
2313
|
1613 |
2934 |
if (DO_UTF8(fromstr)) { |
|
1613 |
0 |
if (DO_UTF8(fromstr)) { |
2316
|
1607 |
6 |
if (!utf8 && !SvUTF8(cat)) { |
|
1589 |
18 |
if (!utf8 && !SvUTF8(cat)) { |
2324
|
1502 |
111 |
if (howlen == e_star) { |
2325
|
3 |
1499 |
if (utf8) goto string_copy; |
2330
|
13 |
101 |
fromlen = datumtype == 'Z' ? len-1 : len; |
2331
|
75 |
114 |
while ((I32) fromlen > 0 && s < end) { |
2335
|
0 |
114 |
if (s > end) |
2337
|
96 |
18 |
if (utf8) { |
2339
|
7 |
89 |
if (datumtype == 'Z') len++; |
2346
|
6 |
12 |
if (datumtype == 'Z') fromlen--; |
2347
|
3 |
15 |
if (howlen == e_star) { |
2349
|
1 |
2 |
if (datumtype == 'Z') len++; |
2351
|
0 |
18 |
GROWING(0, cat, start, cur, len); |
2352
|
0 |
18 |
if (!uni_to_bytes(aTHX_ &aptr, end, cur, fromlen, |
2359
|
32 |
2902 |
} else if (utf8) { |
2360
|
24 |
8 |
if (howlen == e_star) { |
2362
|
0 |
24 |
if (datumtype == 'Z') len++; |
2364
|
32 |
0 |
if (len <= (I32) fromlen) { |
2366
|
2 |
30 |
if (datumtype == 'Z' && fromlen > 0) fromlen--; |
|
1 |
1 |
if (datumtype == 'Z' && fromlen > 0) fromlen--; |
2371
|
0 |
32 |
GROWING(0, cat, start, cur, fromlen*(UTF8_EXPAND-1)+len); |
2373
|
65 |
32 |
while (fromlen > 0) { |
2380
|
1545 |
2952 |
if (howlen == e_star) { |
2382
|
14 |
1531 |
if (datumtype == 'Z') len++; |
2384
|
2531 |
1966 |
if (len <= (I32) fromlen) { |
2386
|
164 |
2367 |
if (datumtype == 'Z' && fromlen > 0) fromlen--; |
|
157 |
7 |
if (datumtype == 'Z' && fromlen > 0) fromlen--; |
2388
|
24 |
4473 |
GROWING(0, cat, start, cur, len); |
2393
|
4118 |
429 |
memset(cur, datumtype == 'A' ? ' ' : '\0', len); |
2395
|
0 |
4547 |
SvTAINT(cat); |
|
0 |
0 |
SvTAINT(cat); |
|
0 |
0 |
SvTAINT(cat); |
2406
|
665 |
0 |
fromstr = NEXTFROM; |
|
665 |
0 |
fromstr = NEXTFROM; |
2407
|
665 |
0 |
str = SvPV_const(fromstr, fromlen); |
2409
|
0 |
665 |
if (DO_UTF8(fromstr)) { |
|
0 |
0 |
if (DO_UTF8(fromstr)) { |
2411
|
0 |
0 |
utf8_flags = warn_utf8 ? 0 : UTF8_ALLOW_ANY; |
2416
|
195 |
470 |
if (howlen == e_star) len = fromlen; |
2418
|
4 |
661 |
GROWING(utf8, cat, start, cur, field_len); |
|
1 |
664 |
GROWING(utf8, cat, start, cur, field_len); |
2419
|
154 |
511 |
if (len > (I32)fromlen) len = fromlen; |
2422
|
235 |
430 |
if (datumtype == 'B') |
2423
|
84503 |
430 |
while (l++ < len) { |
2424
|
0 |
84503 |
if (utf8_source) { |
2426
|
0 |
0 |
NEXT_UNI_VAL(val, cur, str, end, utf8_flags); |
|
0 |
0 |
NEXT_UNI_VAL(val, cur, str, end, utf8_flags); |
2429
|
74011 |
10492 |
if (l & 7) bits <<= 1; |
2431
|
4 |
10488 |
PUSH_BYTE(utf8, cur, bits); |
2437
|
623 |
235 |
while (l++ < len) { |
2438
|
0 |
623 |
if (utf8_source) { |
2440
|
0 |
0 |
NEXT_UNI_VAL(val, cur, str, end, utf8_flags); |
|
0 |
0 |
NEXT_UNI_VAL(val, cur, str, end, utf8_flags); |
2441
|
0 |
0 |
if (val & 1) bits |= 0x80; |
2442
|
441 |
182 |
} else if (*str++ & 1) |
2444
|
615 |
8 |
if (l & 7) bits >>= 1; |
2446
|
4 |
4 |
PUSH_BYTE(utf8, cur, bits); |
2451
|
472 |
193 |
if (l & 7) { |
2452
|
237 |
235 |
if (datumtype == 'B') |
2456
|
4 |
468 |
PUSH_BYTE(utf8, cur, bits); |
2461
|
470 |
195 |
if (howlen == e_star) field_len = 0; |
2475
|
766 |
0 |
fromstr = NEXTFROM; |
|
764 |
2 |
fromstr = NEXTFROM; |
2476
|
739 |
27 |
str = SvPV_const(fromstr, fromlen); |
2478
|
0 |
766 |
if (DO_UTF8(fromstr)) { |
|
0 |
0 |
if (DO_UTF8(fromstr)) { |
2480
|
0 |
0 |
utf8_flags = warn_utf8 ? 0 : UTF8_ALLOW_ANY; |
2485
|
267 |
499 |
if (howlen == e_star) len = fromlen; |
2487
|
4 |
762 |
GROWING(utf8, cat, start, cur, field_len); |
|
3 |
763 |
GROWING(utf8, cat, start, cur, field_len); |
2488
|
762 |
4 |
if (!utf8 && len > (I32)fromlen) len = fromlen; |
|
310 |
452 |
if (!utf8 && len > (I32)fromlen) len = fromlen; |
2491
|
242 |
524 |
if (datumtype == 'H') |
2492
|
8833 |
524 |
while (l++ < len) { |
2493
|
0 |
8833 |
if (utf8_source) { |
2495
|
0 |
0 |
NEXT_UNI_VAL(val, cur, str, end, utf8_flags); |
|
0 |
0 |
NEXT_UNI_VAL(val, cur, str, end, utf8_flags); |
2496
|
0 |
0 |
if (val < 256 && isALPHA(val)) |
|
0 |
0 |
if (val < 256 && isALPHA(val)) |
|
0 |
0 |
if (val < 256 && isALPHA(val)) |
2500
|
3410 |
5423 |
} else if (isALPHA(*str)) |
2504
|
4457 |
4376 |
if (l & 1) bits <<= 4; |
2506
|
4 |
4372 |
PUSH_BYTE(utf8, cur, bits); |
2511
|
425 |
242 |
while (l++ < len) { |
2512
|
0 |
425 |
if (utf8_source) { |
2514
|
0 |
0 |
NEXT_UNI_VAL(val, cur, str, end, utf8_flags); |
|
0 |
0 |
NEXT_UNI_VAL(val, cur, str, end, utf8_flags); |
2515
|
0 |
0 |
if (val < 256 && isALPHA(val)) |
|
0 |
0 |
if (val < 256 && isALPHA(val)) |
|
0 |
0 |
if (val < 256 && isALPHA(val)) |
2519
|
253 |
172 |
} else if (isALPHA(*str)) |
2523
|
253 |
172 |
if (l & 1) bits >>= 4; |
2525
|
4 |
168 |
PUSH_BYTE(utf8, cur, bits); |
2530
|
162 |
604 |
if (l & 1) { |
2531
|
4 |
158 |
PUSH_BYTE(utf8, cur, bits); |
2536
|
499 |
267 |
if (howlen == e_star) field_len = 0; |
2543
|
2101 |
1106 |
while (len-- > 0) { |
2545
|
2101 |
0 |
fromstr = NEXTFROM; |
|
2101 |
0 |
fromstr = NEXTFROM; |
2546
|
2101 |
0 |
aiv = SvIV(fromstr); |
2547
|
6 |
2095 |
if ((-128 > aiv || aiv > 127)) |
2550
|
2 |
2097 |
PUSH_BYTE(utf8, cur, (U8)(aiv & 0xff)); |
2554
|
312227 |
5868 |
if (len == 0) { |
2558
|
315459 |
312225 |
while (len-- > 0) { |
2560
|
315455 |
4 |
fromstr = NEXTFROM; |
|
315455 |
0 |
fromstr = NEXTFROM; |
2561
|
315179 |
280 |
aiv = SvIV(fromstr); |
2562
|
7 |
315452 |
if ((0 > aiv || aiv > 0xff)) |
2565
|
10 |
315447 |
PUSH_BYTE(utf8, cur, (U8)(aiv & 0xff)); |
2573
|
264 |
160 |
if (utf8) end -= UTF8_MAXLEN-1; |
2574
|
1483 |
424 |
while (len-- > 0) { |
2576
|
1483 |
0 |
fromstr = NEXTFROM; |
|
1483 |
0 |
fromstr = NEXTFROM; |
2577
|
0 |
1483 |
auv = SvUV(fromstr); |
2578
|
0 |
1483 |
if (in_bytes) auv = auv % 0x100; |
2579
|
1240 |
243 |
if (utf8) { |
2581
|
31 |
1299 |
if (cur > end) { |
2585
|
31 |
0 |
GROWING(0, cat, start, cur, len+UTF8_MAXLEN); |
2593
|
90 |
153 |
if (auv >= 0x100) { |
2594
|
90 |
0 |
if (!SvUTF8(cat)) { |
2610
|
0 |
153 |
if (cur >= end) { |
2613
|
0 |
0 |
GROWING(0, cat, start, cur, len+1); |
2624
|
25809 |
129420 |
if (len == 0) { |
2625
|
11 |
25798 |
if (!(symptr->flags & FLAG_DO_UTF8)) { |
2635
|
129419 |
1 |
if (!utf8) end -= UTF8_MAXLEN; |
2636
|
139369 |
129420 |
while (len-- > 0) { |
2638
|
139369 |
0 |
fromstr = NEXTFROM; |
|
139369 |
0 |
fromstr = NEXTFROM; |
2639
|
0 |
139369 |
auv = SvUV(fromstr); |
2640
|
1 |
139368 |
if (utf8) { |
2645
|
0 |
1 |
if (cur+(endb-buffer)*UTF8_EXPAND >= end) { |
2648
|
0 |
0 |
GROWING(0, cat, start, cur, |
2654
|
163 |
139205 |
if (cur >= end) { |
2657
|
163 |
0 |
GROWING(0, cat, start, cur, len+UTF8_MAXLEN); |
2669
|
3740 |
782 |
while (len-- > 0) { |
2672
|
3740 |
0 |
fromstr = NEXTFROM; |
|
3737 |
3 |
fromstr = NEXTFROM; |
2673
|
3729 |
11 |
anv = SvNV(fromstr); |
2686
|
1 |
3739 |
PUSH_VAR(utf8, cur, afloat, needs_swap); |
|
1245 |
2494 |
PUSH_VAR(utf8, cur, afloat, needs_swap); |
2690
|
7207 |
1477 |
while (len-- > 0) { |
2693
|
7207 |
0 |
fromstr = NEXTFROM; |
|
7204 |
3 |
fromstr = NEXTFROM; |
2694
|
7201 |
6 |
anv = SvNV(fromstr); |
2707
|
1 |
7206 |
PUSH_VAR(utf8, cur, adouble, needs_swap); |
|
2400 |
4806 |
PUSH_VAR(utf8, cur, adouble, needs_swap); |
2713
|
13088 |
10133 |
while (len-- > 0) { |
2714
|
13088 |
0 |
fromstr = NEXTFROM; |
|
13085 |
3 |
fromstr = NEXTFROM; |
2721
|
1 |
13087 |
PUSH_BYTES(utf8, cur, anv.bytes, sizeof(anv.bytes), needs_swap); |
|
1243 |
11844 |
PUSH_BYTES(utf8, cur, anv.bytes, sizeof(anv.bytes), needs_swap); |
2746
|
1411721 |
311338 |
while (len-- > 0) { |
2748
|
1411715 |
6 |
fromstr = NEXTFROM; |
|
1411616 |
99 |
fromstr = NEXTFROM; |
2749
|
1411719 |
2 |
ai16 = (I16)SvIV(fromstr); |
2750
|
0 |
1411721 |
ai16 = PerlSock_htons(ai16); |
2751
|
3 |
1411718 |
PUSH16(utf8, cur, &ai16, FALSE); |
2756
|
186828 |
13496 |
while (len-- > 0) { |
2758
|
186828 |
0 |
fromstr = NEXTFROM; |
|
186826 |
2 |
fromstr = NEXTFROM; |
2759
|
186826 |
2 |
ai16 = (I16)SvIV(fromstr); |
2761
|
3 |
186825 |
PUSH16(utf8, cur, &ai16, FALSE); |
2777
|
7615 |
1642 |
while (len-- > 0) { |
2779
|
7599 |
16 |
fromstr = NEXTFROM; |
|
7591 |
8 |
fromstr = NEXTFROM; |
2780
|
0 |
7615 |
au16 = (U16)SvUV(fromstr); |
2781
|
6 |
7609 |
PUSH16(utf8, cur, &au16, needs_swap); |
|
2493 |
5116 |
PUSH16(utf8, cur, &au16, needs_swap); |
2797
|
7743 |
1811 |
while (len-- > 0) { |
2799
|
7743 |
0 |
fromstr = NEXTFROM; |
|
7735 |
8 |
fromstr = NEXTFROM; |
2800
|
7694 |
49 |
ai16 = (I16)SvIV(fromstr); |
2801
|
6 |
7737 |
PUSH16(utf8, cur, &ai16, needs_swap); |
|
2504 |
5233 |
PUSH16(utf8, cur, &ai16, needs_swap); |
2806
|
7848 |
1877 |
while (len-- > 0) { |
2808
|
7844 |
4 |
fromstr = NEXTFROM; |
|
7836 |
8 |
fromstr = NEXTFROM; |
2809
|
0 |
7848 |
auint = SvUV(fromstr); |
2810
|
2 |
7846 |
PUSH_VAR(utf8, cur, auint, needs_swap); |
|
2530 |
5316 |
PUSH_VAR(utf8, cur, auint, needs_swap); |
2814
|
3767 |
800 |
while (len-- > 0) { |
2816
|
3767 |
0 |
fromstr = NEXTFROM; |
|
3764 |
3 |
fromstr = NEXTFROM; |
2817
|
3765 |
2 |
aiv = SvIV(fromstr); |
2818
|
1 |
3766 |
PUSH_VAR(utf8, cur, aiv, needs_swap); |
|
1257 |
2509 |
PUSH_VAR(utf8, cur, aiv, needs_swap); |
2822
|
6254583 |
6251568 |
while (len-- > 0) { |
2824
|
6254583 |
0 |
fromstr = NEXTFROM; |
|
6254579 |
4 |
fromstr = NEXTFROM; |
2825
|
1 |
6254582 |
auv = SvUV(fromstr); |
2826
|
1 |
6254582 |
PUSH_VAR(utf8, cur, auv, needs_swap); |
|
1301 |
6253281 |
PUSH_VAR(utf8, cur, auv, needs_swap); |
2830
|
35 |
17 |
while (len-- > 0) { |
2832
|
33 |
2 |
fromstr = NEXTFROM; |
|
33 |
0 |
fromstr = NEXTFROM; |
2833
|
11 |
24 |
anv = SvNV(fromstr); |
2835
|
2 |
33 |
if (anv < 0) { |
2846
|
10 |
23 |
if (SvIOK(fromstr) || anv < UV_MAX_P1) { |
|
5 |
5 |
if (SvIOK(fromstr) || anv < UV_MAX_P1) { |
2849
|
4 |
24 |
UV auv = SvUV(fromstr); |
2854
|
116 |
28 |
} while (auv); |
2856
|
2 |
26 |
PUSH_GROWING_BYTES(utf8, cat, start, cur, |
|
1 |
27 |
PUSH_GROWING_BYTES(utf8, cat, start, cur, |
|
2 |
26 |
PUSH_GROWING_BYTES(utf8, cat, start, cur, |
2858
|
2 |
3 |
} else if (SvPOKp(fromstr)) |
2860
|
2 |
0 |
else if (SvNOKp(fromstr)) { |
2883
|
1 |
302 |
if (in <= buf) /* this cannot happen ;-) */ |
2887
|
301 |
1 |
} while (anv > 0); |
2889
|
0 |
1 |
PUSH_GROWING_BYTES(utf8, cat, start, cur, |
|
1 |
0 |
PUSH_GROWING_BYTES(utf8, cat, start, cur, |
|
0 |
1 |
PUSH_GROWING_BYTES(utf8, cat, start, cur, |
2900
|
3 |
0 |
from = SvPV_const(fromstr, len); |
2901
|
2 |
1 |
if ((norm = is_an_int(from, len)) == NULL) |
2907
|
15 |
1 |
while (!done) *--in = div128(norm, &done) | 0x80; |
2909
|
0 |
1 |
PUSH_GROWING_BYTES(utf8, cat, start, cur, |
|
1 |
0 |
PUSH_GROWING_BYTES(utf8, cat, start, cur, |
|
0 |
1 |
PUSH_GROWING_BYTES(utf8, cat, start, cur, |
2918
|
7588 |
1672 |
while (len-- > 0) { |
2920
|
7588 |
0 |
fromstr = NEXTFROM; |
|
7580 |
8 |
fromstr = NEXTFROM; |
2921
|
7575 |
13 |
aint = SvIV(fromstr); |
2922
|
2 |
7586 |
PUSH_VAR(utf8, cur, aint, needs_swap); |
|
2501 |
5085 |
PUSH_VAR(utf8, cur, aint, needs_swap); |
2927
|
52561 |
38385 |
while (len-- > 0) { |
2929
|
52554 |
7 |
fromstr = NEXTFROM; |
|
52552 |
2 |
fromstr = NEXTFROM; |
2930
|
0 |
52561 |
au32 = SvUV(fromstr); |
2931
|
0 |
52561 |
au32 = PerlSock_htonl(au32); |
2932
|
219 |
52342 |
PUSH32(utf8, cur, &au32, FALSE); |
2937
|
18163 |
17113 |
while (len-- > 0) { |
2939
|
18163 |
0 |
fromstr = NEXTFROM; |
|
18161 |
2 |
fromstr = NEXTFROM; |
2940
|
0 |
18163 |
au32 = SvUV(fromstr); |
2942
|
3 |
18160 |
PUSH32(utf8, cur, &au32, FALSE); |
2947
|
8067 |
5115 |
while (len-- > 0) { |
2949
|
8067 |
0 |
fromstr = NEXTFROM; |
|
8062 |
5 |
fromstr = NEXTFROM; |
2950
|
1 |
8066 |
aulong = SvUV(fromstr); |
2951
|
1 |
8066 |
PUSH_VAR(utf8, cur, aulong, needs_swap); |
|
1243 |
6823 |
PUSH_VAR(utf8, cur, aulong, needs_swap); |
2958
|
3861 |
903 |
while (len-- > 0) { |
2960
|
3857 |
4 |
fromstr = NEXTFROM; |
|
3854 |
3 |
fromstr = NEXTFROM; |
2961
|
0 |
3861 |
au32 = SvUV(fromstr); |
2962
|
5 |
3856 |
PUSH32(utf8, cur, &au32, needs_swap); |
|
1280 |
2576 |
PUSH32(utf8, cur, &au32, needs_swap); |
2967
|
3746 |
794 |
while (len-- > 0) { |
2969
|
3746 |
0 |
fromstr = NEXTFROM; |
|
3741 |
5 |
fromstr = NEXTFROM; |
2970
|
3744 |
2 |
along = SvIV(fromstr); |
2971
|
1 |
3745 |
PUSH_VAR(utf8, cur, along, needs_swap); |
|
1247 |
2498 |
PUSH_VAR(utf8, cur, along, needs_swap); |
2978
|
3777 |
819 |
while (len-- > 0) { |
2980
|
3777 |
0 |
fromstr = NEXTFROM; |
|
3774 |
3 |
fromstr = NEXTFROM; |
2981
|
3775 |
2 |
ai32 = SvIV(fromstr); |
2982
|
5 |
3772 |
PUSH32(utf8, cur, &ai32, needs_swap); |
|
1257 |
2515 |
PUSH32(utf8, cur, &ai32, needs_swap); |
2987
|
3584 |
746 |
while (len-- > 0) { |
2989
|
3584 |
0 |
fromstr = NEXTFROM; |
|
3581 |
3 |
fromstr = NEXTFROM; |
2990
|
43 |
3541 |
auquad = (Uquad_t) SvUV(fromstr); |
2991
|
3 |
3581 |
PUSH_VAR(utf8, cur, auquad, needs_swap); |
|
1165 |
2416 |
PUSH_VAR(utf8, cur, auquad, needs_swap); |
2995
|
3600 |
762 |
while (len-- > 0) { |
2997
|
3600 |
0 |
fromstr = NEXTFROM; |
|
3597 |
3 |
fromstr = NEXTFROM; |
2998
|
3598 |
2 |
aquad = (Quad_t)SvIV(fromstr); |
2999
|
3 |
3597 |
PUSH_VAR(utf8, cur, aquad, needs_swap); |
|
1169 |
2428 |
PUSH_VAR(utf8, cur, aquad, needs_swap); |
3005
|
1 |
703 |
GROWING(utf8, cat, start, cur, sizeof(char *)); |
|
1 |
703 |
GROWING(utf8, cat, start, cur, sizeof(char *)); |
3008
|
0 |
4186 |
while (len-- > 0) { |
|
4186 |
1414 |
while (len-- > 0) { |
3011
|
4186 |
0 |
fromstr = NEXTFROM; |
|
4180 |
6 |
fromstr = NEXTFROM; |
3013
|
3 |
4183 |
if (!SvOK(fromstr)) aptr = NULL; |
|
3 |
0 |
if (!SvOK(fromstr)) aptr = NULL; |
|
3 |
0 |
if (!SvOK(fromstr)) aptr = NULL; |
3020
|
4180 |
3 |
if ((SvTEMP(fromstr) || (SvPADTMP(fromstr) && |
|
0 |
4180 |
if ((SvTEMP(fromstr) || (SvPADTMP(fromstr) && |
3025
|
4183 |
0 |
if (SvPOK(fromstr) || SvNIOK(fromstr)) |
3026
|
4180 |
3 |
aptr = SvPV_nomg_const_nolen(fromstr); |
3028
|
0 |
0 |
aptr = SvPV_force_flags_nolen(fromstr, 0); |
3030
|
2 |
4184 |
PUSH_VAR(utf8, cur, aptr, needs_swap); |
|
1391 |
2793 |
PUSH_VAR(utf8, cur, aptr, needs_swap); |
3037
|
51 |
0 |
fromstr = NEXTFROM; |
|
51 |
0 |
fromstr = NEXTFROM; |
3038
|
3 |
48 |
if (len <= 2) len = 45; |
3040
|
2 |
49 |
if (len >= 64) { |
3045
|
50 |
0 |
aptr = SvPV_const(fromstr, fromlen); |
3046
|
1 |
49 |
from_utf8 = DO_UTF8(fromstr); |
|
0 |
1 |
from_utf8 = DO_UTF8(fromstr); |
3047
|
1 |
49 |
if (from_utf8) { |
3051
|
0 |
50 |
GROWING(utf8, cat, start, cur, (fromlen+2) / 3 * 4 + (fromlen+len-1)/len * 2); |
|
7 |
43 |
GROWING(utf8, cat, start, cur, (fromlen+2) / 3 * 4 + (fromlen+len-1)/len * 2); |
3052
|
59 |
50 |
while (fromlen > 0) { |
3057
|
50 |
9 |
if ((I32)fromlen > len) |
3061
|
1 |
58 |
if (from_utf8) { |
3063
|
0 |
1 |
if (!uni_to_bytes(aTHX_ &aptr, aend, buffer, todo, |
3076
|
0 |
59 |
PUSH_BYTES(utf8, cur, hunk, end-hunk, 0); |
3098
|
6777766 |
3 |
const char *pat = SvPV_const(pat_sv, fromlen); |
3107
|
0 |
6777619 |
SvSETMAGIC(cat); |