| 760 | } |
| 761 | |
| 762 | static NODISCARD demangle_status parser_integer_62(struct parser *parser, uint64_t *out) { |
| 763 | if (parser_eat(parser, '_')) { |
| 764 | *out = 0; |
| 765 | return DemangleOk; |
| 766 | } |
| 767 | |
| 768 | uint64_t x = 0; |
| 769 | demangle_status status; |
| 770 | while (!parser_eat(parser, '_')) { |
| 771 | uint64_t d; |
| 772 | if ((status = parser_digit_62(parser, &d)) != DemangleOk) { |
| 773 | return status; |
| 774 | } |
| 775 | if (x > UINT64_MAX / 62) { |
| 776 | return DemangleInvalid; |
| 777 | } |
| 778 | x *= 62; |
| 779 | if (x > UINT64_MAX - d) { |
| 780 | return DemangleInvalid; |
| 781 | } |
| 782 | x += d; |
| 783 | } |
| 784 | if (x == UINT64_MAX) { |
| 785 | return DemangleInvalid; |
| 786 | } |
| 787 | *out = x + 1; |
| 788 | return DemangleOk; |
| 789 | } |
| 790 | |
| 791 | static NODISCARD demangle_status parser_opt_integer_62(struct parser *parser, uint8_t tag, uint64_t *out) { |
| 792 | if (!parser_eat(parser, tag)) { |
nothing calls this directly
no test coverage detected