| 853 | } |
| 854 | |
| 855 | static bool cv2_header(cv2_context_t *ctx, cv2_span_t profiles) { |
| 856 | cv2_span_t fields[4]; |
| 857 | uint64_t version, count; |
| 858 | if (!cv2_row(ctx, profiles, &ctx->profile_start, false, fields)) |
| 859 | return false; |
| 860 | if (!cv2_literal(fields[0], "CBM_PROFILE_MAP", 15)) |
| 861 | return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT); |
| 862 | if (!cv2_decimal(ctx, fields[1], true, &version) || !cv2_image(ctx, fields[2]) || |
| 863 | !cv2_decimal(ctx, fields[3], true, &count)) |
| 864 | return false; |
| 865 | if (version != 2) |
| 866 | return cv2_fail(ctx, CBM_COVERAGE_PARSE_UNSUPPORTED); |
| 867 | if (count > INT_MAX || count > (uint64_t)ctx->limits->max_ids) |
| 868 | return cv2_fail(ctx, CBM_COVERAGE_PARSE_LIMIT); |
| 869 | ctx->profile_count = (int)count; |
| 870 | return cv2_items(ctx, 1); |
| 871 | } |
| 872 | |
| 873 | static bool cv2_profile_inventory(cv2_context_t *ctx, cv2_span_t profiles) { |
| 874 | size_t position = ctx->profile_start; |
no test coverage detected