diff options
author | Chris Mihelich <cmihelic@google.com> | 2024-05-23 15:28:19 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-05-23 15:30:43 -0700 |
commit | d60c089e06b638483db5995d16550303225b1b5b (patch) | |
tree | e8dfd7e8d0b24c568125c983679f9b6194f8c102 /absl/debugging/internal/demangle.cc | |
parent | b3cd02500c67749ee7441987cb7d37c89aead79b (diff) | |
download | abseil-d60c089e06b638483db5995d16550303225b1b5b.tar.gz abseil-d60c089e06b638483db5995d16550303225b1b5b.tar.bz2 abseil-d60c089e06b638483db5995d16550303225b1b5b.zip |
Demangle the C++ this pointer (fpT).
PiperOrigin-RevId: 636695970
Change-Id: I22d6f13271ab965563f1f575d9d7ba0ed1af466d
Diffstat (limited to 'absl/debugging/internal/demangle.cc')
-rw-r--r-- | absl/debugging/internal/demangle.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/absl/debugging/internal/demangle.cc b/absl/debugging/internal/demangle.cc index 6d24f8ed..72462ee9 100644 --- a/absl/debugging/internal/demangle.cc +++ b/absl/debugging/internal/demangle.cc @@ -300,8 +300,8 @@ static bool ParseOneCharToken(State *state, const char one_char_token) { return false; } -// Returns true and advances "mangled_cur" if we find "two_char_token" -// at "mangled_cur" position. It is assumed that "two_char_token" does +// Returns true and advances "mangled_idx" if we find "two_char_token" +// at "mangled_idx" position. It is assumed that "two_char_token" does // not contain '\0'. static bool ParseTwoCharToken(State *state, const char *two_char_token) { ComplexityGuard guard(state); @@ -314,6 +314,21 @@ static bool ParseTwoCharToken(State *state, const char *two_char_token) { return false; } +// Returns true and advances "mangled_idx" if we find "three_char_token" +// at "mangled_idx" position. It is assumed that "three_char_token" does +// not contain '\0'. +static bool ParseThreeCharToken(State *state, const char *three_char_token) { + ComplexityGuard guard(state); + if (guard.IsTooComplex()) return false; + if (RemainingInput(state)[0] == three_char_token[0] && + RemainingInput(state)[1] == three_char_token[1] && + RemainingInput(state)[2] == three_char_token[2]) { + state->parse_state.mangled_idx += 3; + return true; + } + return false; +} + // Returns true and advances "mangled_cur" if we find any character in // "char_class" at "mangled_cur" position. static bool ParseCharClass(State *state, const char *char_class) { @@ -1759,6 +1774,7 @@ static bool ParseUnionSelector(State *state) { // ::= fp <(top-level) CV-qualifiers> <number> _ // ::= fL <number> p <(top-level) CV-qualifiers> _ // ::= fL <number> p <(top-level) CV-qualifiers> <number> _ +// ::= fpT # this static bool ParseFunctionParam(State *state) { ComplexityGuard guard(state); if (guard.IsTooComplex()) return false; @@ -1780,7 +1796,7 @@ static bool ParseFunctionParam(State *state) { } state->parse_state = copy; - return false; + return ParseThreeCharToken(state, "fpT"); } // <braced-expression> ::= <expression> |