line |
true |
false |
branch |
46
|
0 |
5098 |
BSON_ASSERT (iter); |
47
|
0 |
5098 |
BSON_ASSERT (bson); |
49
|
0 |
5098 |
if (BSON_UNLIKELY (bson->len < 5)) { |
94
|
0 |
262 |
BSON_ASSERT (iter); |
95
|
0 |
262 |
BSON_ASSERT (child); |
97
|
248 |
14 |
if (ITER_TYPE (iter) == BSON_TYPE_DOCUMENT) { |
99
|
14 |
0 |
} else if (ITER_TYPE (iter) == BSON_TYPE_ARRAY) { |
143
|
0 |
0 |
BSON_ASSERT (iter); |
144
|
0 |
0 |
BSON_ASSERT (bson); |
145
|
0 |
0 |
BSON_ASSERT (key); |
147
|
0 |
0 |
return bson_iter_init (iter, bson) && bson_iter_find (iter, key); |
|
0 |
0 |
return bson_iter_init (iter, bson) && bson_iter_find (iter, key); |
172
|
0 |
0 |
BSON_ASSERT (iter); |
173
|
0 |
0 |
BSON_ASSERT (bson); |
174
|
0 |
0 |
BSON_ASSERT (key); |
176
|
0 |
0 |
return bson_iter_init (iter, bson) && bson_iter_find_case (iter, key); |
|
0 |
0 |
return bson_iter_init (iter, bson) && bson_iter_find_case (iter, key); |
203
|
0 |
0 |
if (keylen == 0) { |
207
|
0 |
0 |
if (keylen < 0) { |
211
|
0 |
0 |
while (bson_iter_next (iter)) { |
214
|
0 |
0 |
if ((0 == strncmp (key, ikey, keylen)) && (ikey [keylen] == '\0')) { |
|
0 |
0 |
if ((0 == strncmp (key, ikey, keylen)) && (ikey [keylen] == '\0')) { |
245
|
0 |
0 |
BSON_ASSERT (iter); |
246
|
0 |
0 |
BSON_ASSERT (key); |
274
|
0 |
0 |
BSON_ASSERT (iter); |
275
|
0 |
0 |
BSON_ASSERT (key); |
277
|
0 |
0 |
while (bson_iter_next (iter)) { |
281
|
0 |
0 |
if (!strcasecmp (key, bson_iter_key (iter))) { |
318
|
0 |
0 |
BSON_ASSERT (iter); |
319
|
0 |
0 |
BSON_ASSERT (dotkey); |
320
|
0 |
0 |
BSON_ASSERT (descendant); |
322
|
0 |
0 |
if ((dot = strchr (dotkey, '.'))) { |
328
|
0 |
0 |
if (_bson_iter_find_with_len (iter, dotkey, (int)sublen)) { |
329
|
0 |
0 |
if (!dot) { |
334
|
0 |
0 |
if (BSON_ITER_HOLDS_DOCUMENT (iter) || BSON_ITER_HOLDS_ARRAY (iter)) { |
|
0 |
0 |
if (BSON_ITER_HOLDS_DOCUMENT (iter) || BSON_ITER_HOLDS_ARRAY (iter)) { |
335
|
0 |
0 |
if (bson_iter_recurse (iter, &tmp)) { |
365
|
0 |
1917 |
BSON_ASSERT (iter); |
391
|
0 |
2034 |
BSON_ASSERT (iter); |
392
|
0 |
2034 |
BSON_ASSERT (iter->raw); |
393
|
0 |
2034 |
BSON_ASSERT (iter->len); |
432
|
0 |
7405 |
BSON_ASSERT (iter); |
436
|
0 |
7405 |
if (!iter->raw) { |
453
|
9087 |
3549 |
for (o = iter->off + 1; o < len; o++) { |
454
|
3856 |
5231 |
if (!data [o]) { |
480
|
0 |
269 |
if ((o + 4) >= len) { |
489
|
6 |
263 |
if (l > (len - (o + 4))) { |
499
|
259 |
4 |
if (BSON_UNLIKELY ((l == 0) || (iter->next_off >= len))) { |
|
5 |
254 |
if (BSON_UNLIKELY ((l == 0) || (iter->next_off >= len))) { |
507
|
3 |
251 |
if (BSON_UNLIKELY ((iter->raw + iter->d2)[l - 1] != '\0')) { |
518
|
0 |
60 |
if (o >= (len - 4)) { |
529
|
2 |
58 |
if (l >= (len - o)) { |
536
|
10 |
48 |
if (subtype == BSON_SUBTYPE_BINARY_DEPRECATED) { |
537
|
0 |
10 |
if (l < 4) { |
551
|
0 |
524 |
if (o >= (len - 4)) { |
559
|
524 |
0 |
if ((l > len) || (l > (len - o))) { |
|
0 |
524 |
if ((l > len) || (l > (len - o))) { |
574
|
24 |
10 |
if ( val != 0x00 && val != 0x01 ) { |
|
2 |
22 |
if ( val != 0x00 && val != 0x01 ) { |
587
|
250 |
0 |
for (; o < len; o++) { |
588
|
48 |
202 |
if (!data [o]) { |
595
|
0 |
48 |
if (!eor) { |
600
|
118 |
0 |
for (; o < len; o++) { |
601
|
48 |
70 |
if (!data [o]) { |
607
|
0 |
48 |
if (!eoo) { |
619
|
0 |
19 |
if (o >= (len - 4)) { |
628
|
18 |
1 |
if ((l > len) || (l > (len - o))) { |
|
0 |
18 |
if ((l > len) || (l > (len - o))) { |
633
|
1 |
17 |
if ( *(iter->raw + o + l + 3) ) { |
648
|
39 |
0 |
if ((len < 19) || (o >= (len - 14))) { |
|
0 |
39 |
if ((len < 19) || (o >= (len - 14))) { |
659
|
37 |
2 |
if ((l < 14) || (l >= (len - o))) { |
|
3 |
34 |
if ((l < 14) || (l >= (len - o))) { |
666
|
0 |
34 |
if (iter->next_off >= len) { |
674
|
2 |
32 |
if (l >= (len - o - 4 - 4)) { |
679
|
0 |
32 |
if ((o + 4 + 4 + l + 4) >= iter->next_off) { |
688
|
3 |
29 |
if ((o + 4 + 4 + l + doclen) != iter->next_off) { |
720
|
9 |
3802 |
if (iter->next_off >= len) { |
804
|
0 |
58 |
BSON_ASSERT (iter); |
805
|
58 |
0 |
BSON_ASSERT (!binary || binary_len); |
|
0 |
58 |
BSON_ASSERT (!binary || binary_len); |
807
|
58 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_BINARY) { |
808
|
0 |
58 |
if (!subtype) { |
814
|
58 |
0 |
if (binary) { |
819
|
10 |
48 |
if (*subtype == BSON_SUBTYPE_BINARY_DEPRECATED) { |
828
|
0 |
0 |
if (binary) { |
832
|
0 |
0 |
if (binary_len) { |
836
|
0 |
0 |
if (subtype) { |
861
|
0 |
18 |
BSON_ASSERT (iter); |
863
|
18 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_BOOL) { |
894
|
0 |
0 |
BSON_ASSERT (iter); |
935
|
0 |
59 |
BSON_ASSERT (iter); |
937
|
59 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_DOUBLE) { |
964
|
0 |
70 |
BSON_ASSERT (iter); |
966
|
70 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_INT32) { |
994
|
0 |
25 |
BSON_ASSERT (iter); |
996
|
25 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_INT64) { |
1028
|
0 |
0 |
BSON_ASSERT (iter); |
1066
|
0 |
2412 |
BSON_ASSERT (iter); |
1068
|
2412 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_DECIMAL128) { |
1097
|
0 |
21 |
BSON_ASSERT (iter); |
1099
|
21 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_OID) { |
1131
|
0 |
48 |
BSON_ASSERT (iter); |
1133
|
48 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_REGEX) { |
1138
|
48 |
0 |
if (options) { |
1171
|
0 |
207 |
BSON_ASSERT (iter); |
1173
|
207 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_UTF8) { |
1174
|
207 |
0 |
if (length) { |
1181
|
0 |
0 |
if (length) { |
1215
|
0 |
0 |
BSON_ASSERT (iter); |
1217
|
0 |
0 |
if ((str = bson_iter_utf8 (iter, &local_length))) { |
1223
|
0 |
0 |
if (length) { |
1257
|
0 |
20 |
BSON_ASSERT (iter); |
1259
|
20 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_CODE) { |
1260
|
20 |
0 |
if (length) { |
1267
|
0 |
0 |
if (length) { |
1310
|
0 |
29 |
BSON_ASSERT (iter); |
1312
|
29 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_CODEWSCOPE) { |
1313
|
29 |
0 |
if (length) { |
1324
|
0 |
0 |
if (length) { |
1328
|
0 |
0 |
if (scope_len) { |
1332
|
0 |
0 |
if (scope) { |
1376
|
0 |
15 |
BSON_ASSERT (iter); |
1378
|
15 |
0 |
if (collection) { |
1382
|
15 |
0 |
if (oid) { |
1386
|
15 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_DBPOINTER) { |
1387
|
15 |
0 |
if (collection_len) { |
1391
|
14 |
1 |
if ((*collection_len) > 0) { |
1396
|
15 |
0 |
if (collection) { |
1400
|
15 |
0 |
if (oid) { |
1436
|
0 |
24 |
BSON_ASSERT (iter); |
1438
|
24 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_SYMBOL) { |
1443
|
24 |
0 |
if (length) { |
1471
|
0 |
23 |
BSON_ASSERT (iter); |
1473
|
23 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_DATE_TIME) { |
1501
|
0 |
0 |
BSON_ASSERT (iter); |
1503
|
0 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_DATE_TIME) { |
1542
|
0 |
18 |
BSON_ASSERT (iter); |
1544
|
18 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_TIMESTAMP) { |
1551
|
18 |
0 |
if (timestamp) { |
1555
|
18 |
0 |
if (increment) { |
1586
|
0 |
0 |
BSON_ASSERT (iter); |
1588
|
0 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_DATE_TIME) { |
1645
|
0 |
494 |
BSON_ASSERT (iter); |
1646
|
0 |
494 |
BSON_ASSERT (document_len); |
1647
|
0 |
494 |
BSON_ASSERT (document); |
1652
|
494 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_DOCUMENT) { |
1707
|
0 |
28 |
BSON_ASSERT (iter); |
1708
|
0 |
28 |
BSON_ASSERT (array_len); |
1709
|
0 |
28 |
BSON_ASSERT (array); |
1714
|
28 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_ARRAY) { |
1792
|
0 |
1890 |
BSON_ASSERT (iter); |
1793
|
0 |
1890 |
BSON_ASSERT (visitor); |
1795
|
1885 |
1873 |
while (_bson_iter_next_internal (iter, &key, &bson_type, &unsupported)) { |
1796
|
1881 |
4 |
if (*key && !bson_utf8_validate (key, strlen (key), false)) { |
|
0 |
1881 |
if (*key && !bson_utf8_validate (key, strlen (key), false)) { |
1801
|
1885 |
0 |
if (VISIT_BEFORE (iter, key, data)) { |
|
0 |
1885 |
if (VISIT_BEFORE (iter, key, data)) { |
1808
|
0 |
59 |
if (VISIT_DOUBLE (iter, key, bson_iter_double (iter), data)) { |
|
0 |
0 |
if (VISIT_DOUBLE (iter, key, bson_iter_double (iter), data)) { |
1820
|
3 |
99 |
if (!bson_utf8_validate (utf8, utf8_len, true)) { |
1825
|
99 |
0 |
if (VISIT_UTF8 (iter, key, utf8_len, utf8, data)) { |
|
0 |
99 |
if (VISIT_UTF8 (iter, key, utf8_len, utf8, data)) { |
1838
|
245 |
1 |
if (bson_init_static (&b, docbuf, doclen) && |
|
245 |
0 |
if (bson_init_static (&b, docbuf, doclen) && |
1839
|
0 |
245 |
VISIT_DOCUMENT (iter, key, &b, data)) { |
1852
|
14 |
0 |
if (bson_init_static (&b, docbuf, doclen) |
1853
|
14 |
0 |
&& VISIT_ARRAY (iter, key, &b, data)) { |
|
0 |
14 |
&& VISIT_ARRAY (iter, key, &b, data)) { |
1866
|
0 |
29 |
if (VISIT_BINARY (iter, key, subtype, binary_len, binary, data)) { |
|
0 |
0 |
if (VISIT_BINARY (iter, key, subtype, binary_len, binary, data)) { |
1873
|
0 |
2 |
if (VISIT_UNDEFINED (iter, key, data)) { |
|
0 |
0 |
if (VISIT_UNDEFINED (iter, key, data)) { |
1880
|
0 |
19 |
if (VISIT_OID (iter, key, bson_iter_oid (iter), data)) { |
|
0 |
0 |
if (VISIT_OID (iter, key, bson_iter_oid (iter), data)) { |
1887
|
0 |
14 |
if (VISIT_BOOL (iter, key, bson_iter_bool (iter), data)) { |
|
0 |
0 |
if (VISIT_BOOL (iter, key, bson_iter_bool (iter), data)) { |
1894
|
0 |
17 |
if (VISIT_DATE_TIME (iter, key, bson_iter_date_time (iter), data)) { |
|
0 |
0 |
if (VISIT_DATE_TIME (iter, key, bson_iter_date_time (iter), data)) { |
1901
|
0 |
7 |
if (VISIT_NULL (iter, key, data)) { |
|
0 |
0 |
if (VISIT_NULL (iter, key, data)) { |
1912
|
0 |
24 |
if (VISIT_REGEX (iter, key, regex, options, data)) { |
|
0 |
0 |
if (VISIT_REGEX (iter, key, regex, options, data)) { |
1925
|
0 |
8 |
if (VISIT_DBPOINTER (iter, key, collection_len, collection, oid, |
|
0 |
0 |
if (VISIT_DBPOINTER (iter, key, collection_len, collection, oid, |
1938
|
0 |
10 |
if (VISIT_CODE (iter, key, code_len, code, data)) { |
|
0 |
0 |
if (VISIT_CODE (iter, key, code_len, code, data)) { |
1950
|
0 |
12 |
if (VISIT_SYMBOL (iter, key, symbol_len, symbol, data)) { |
|
0 |
0 |
if (VISIT_SYMBOL (iter, key, symbol_len, symbol, data)) { |
1965
|
15 |
0 |
if (bson_init_static (&b, docbuf, doclen) && |
|
15 |
0 |
if (bson_init_static (&b, docbuf, doclen) && |
1966
|
14 |
1 |
VISIT_CODEWSCOPE (iter, key, length, code, &b, data)) { |
1973
|
0 |
60 |
if (VISIT_INT32 (iter, key, bson_iter_int32 (iter), data)) { |
|
0 |
0 |
if (VISIT_INT32 (iter, key, bson_iter_int32 (iter), data)) { |
1984
|
0 |
8 |
if (VISIT_TIMESTAMP (iter, key, timestamp, increment, data)) { |
|
0 |
0 |
if (VISIT_TIMESTAMP (iter, key, timestamp, increment, data)) { |
1991
|
0 |
25 |
if (VISIT_INT64 (iter, key, bson_iter_int64 (iter), data)) { |
|
0 |
0 |
if (VISIT_INT64 (iter, key, bson_iter_int64 (iter), data)) { |
2001
|
0 |
1206 |
if (VISIT_DECIMAL128 (iter, key, &dec, data)) { |
|
0 |
0 |
if (VISIT_DECIMAL128 (iter, key, &dec, data)) { |
2008
|
0 |
4 |
if (VISIT_MAXKEY (iter, bson_iter_key_unsafe (iter), data)) { |
|
0 |
0 |
if (VISIT_MAXKEY (iter, bson_iter_key_unsafe (iter), data)) { |
2015
|
0 |
4 |
if (VISIT_MINKEY (iter, bson_iter_key_unsafe (iter), data)) { |
|
0 |
0 |
if (VISIT_MINKEY (iter, bson_iter_key_unsafe (iter), data)) { |
2025
|
0 |
1868 |
if (VISIT_AFTER (iter, bson_iter_key_unsafe (iter), data)) { |
|
0 |
0 |
if (VISIT_AFTER (iter, bson_iter_key_unsafe (iter), data)) { |
2030
|
54 |
1819 |
if (iter->err_off) { |
2031
|
5 |
49 |
if (unsupported && |
|
5 |
0 |
if (unsupported && |
2032
|
5 |
0 |
visitor->visit_unsupported_type && |
2038
|
49 |
0 |
VISIT_CORRUPT (iter, data); |
2068
|
0 |
0 |
BSON_ASSERT (iter); |
2071
|
0 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_BOOL) { |
2098
|
0 |
0 |
BSON_ASSERT (iter); |
2100
|
0 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_INT32) { |
2130
|
0 |
0 |
BSON_ASSERT (iter); |
2132
|
0 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_INT64) { |
2162
|
0 |
0 |
BSON_ASSERT (iter); |
2164
|
0 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_DOUBLE) { |
2191
|
0 |
0 |
BSON_ASSERT (iter); |
2193
|
0 |
0 |
if (ITER_TYPE (iter) == BSON_TYPE_DECIMAL128) { |
2230
|
0 |
0 |
BSON_ASSERT (iter); |