summaryrefslogtreecommitdiff
path: root/src/cxa_demangle.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-01-24 19:57:05 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-01-24 19:57:05 +0000
commit38a106017af27c76923424fb9863ea8f6e9509e1 (patch)
tree33fd9a3eeb9fbe9ade3c74d379bf47f0b2436636 /src/cxa_demangle.cpp
parentb31402407404e987cf39b833005f6a63a95f1744 (diff)
cxa_demangle: fix rvalue ref check
When checking if the type is a r-value ref, we would not do a complete check. This would result in us treating a trailing parameter reference `&)` as a r-value ref, and improperly inject the cv qualifier on the type. We now correctly demangle the type `KFvRmE` as a constant function rather than a constant reference. Fixes PR31741! git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@292973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/cxa_demangle.cpp')
-rw-r--r--src/cxa_demangle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cxa_demangle.cpp b/src/cxa_demangle.cpp
index 18a095b..8f5cb30 100644
--- a/src/cxa_demangle.cpp
+++ b/src/cxa_demangle.cpp
@@ -1927,7 +1927,8 @@ parse_type(const char* first, const char* last, C& db)
if (is_function)
{
size_t p = db.names[k].second.size();
- if (db.names[k].second[p-2] == '&')
+ if (db.names[k].second[p - 2] == '&' &&
+ db.names[k].second[p - 1] == '&')
p -= 2;
else if (db.names[k].second.back() == '&')
p -= 1;