MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / demangle_status parser_integer_62

Function demangle_status parser_integer_62

src/rustDemangle.cpp:762–789  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

760}
761
762static 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
791static NODISCARD demangle_status parser_opt_integer_62(struct parser *parser, uint8_t tag, uint64_t *out) {
792 if (!parser_eat(parser, tag)) {

Callers

nothing calls this directly

Calls 1

parser_eatFunction · 0.85

Tested by

no test coverage detected