| 1413 | #define CBM_PERL_MAX_PARSE_NESTING 128 |
| 1414 | |
| 1415 | static bool cbm_source_nesting_exceeds(const char *source, int source_len, int cap) { |
| 1416 | int depth = 0; |
| 1417 | for (int i = 0; i < source_len; i++) { |
| 1418 | char c = source[i]; |
| 1419 | if (c == '(' || c == '[' || c == '{') { |
| 1420 | if (++depth > cap) { |
| 1421 | return true; |
| 1422 | } |
| 1423 | } else if ((c == ')' || c == ']' || c == '}') && depth > 0) { |
| 1424 | depth--; |
| 1425 | } |
| 1426 | } |
| 1427 | return false; |
| 1428 | } |
| 1429 | |
| 1430 | /* Best-effort parse-coverage collection (#963). Walks only the has_error paths |
| 1431 | * of the tree and records the 1-based line ranges of the TOP-MOST ERROR/MISSING |
no outgoing calls
no test coverage detected