diff options
author | Benjamin Barenblat <bbaren@google.com> | 2021-04-08 10:23:55 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@google.com> | 2021-04-08 10:23:55 -0400 |
commit | feac56827dd1f0d159ea0bcf2ce37ef1990ac743 (patch) | |
tree | bc8ca767be02a5b22118108f9712b72ec64064c3 /absl/debugging/internal/demangle.cc | |
parent | 2b91b17d526b464840a3f45504c594cdb50152c5 (diff) | |
parent | 997aaf3a28308eba1b9156aa35ab7bca9688e9f6 (diff) |
Merge new upstream LTS 20210324.0
Diffstat (limited to 'absl/debugging/internal/demangle.cc')
-rw-r--r-- | absl/debugging/internal/demangle.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/absl/debugging/internal/demangle.cc b/absl/debugging/internal/demangle.cc index 46cdb67b..5cd56320 100644 --- a/absl/debugging/internal/demangle.cc +++ b/absl/debugging/internal/demangle.cc @@ -386,24 +386,28 @@ static bool IsDigit(char c) { return c >= '0' && c <= '9'; } // by GCC 4.5.x and later versions (and our locally-modified version of GCC // 4.4.x) to indicate functions which have been cloned during optimization. // We treat any sequence (.<alpha>+.<digit>+)+ as a function clone suffix. +// Additionally, '_' is allowed along with the alphanumeric sequence. static bool IsFunctionCloneSuffix(const char *str) { size_t i = 0; while (str[i] != '\0') { - // Consume a single .<alpha>+.<digit>+ sequence. - if (str[i] != '.' || !IsAlpha(str[i + 1])) { - return false; + bool parsed = false; + // Consume a single [.<alpha> | _]*[.<digit>]* sequence. + if (str[i] == '.' && (IsAlpha(str[i + 1]) || str[i + 1] == '_')) { + parsed = true; + i += 2; + while (IsAlpha(str[i]) || str[i] == '_') { + ++i; + } } - i += 2; - while (IsAlpha(str[i])) { - ++i; + if (str[i] == '.' && IsDigit(str[i + 1])) { + parsed = true; + i += 2; + while (IsDigit(str[i])) { + ++i; + } } - if (str[i] != '.' || !IsDigit(str[i + 1])) { + if (!parsed) return false; - } - i += 2; - while (IsDigit(str[i])) { - ++i; - } } return true; // Consumed everything in "str". } |