diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-24 18:52:19 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-24 18:52:19 +0000 |
commit | c38cd326fcd7a62cf188a1c0beb5af47ced8b2ac (patch) | |
tree | c3dd21c9fc0b5a0236dfd99407f80cb6d9486a62 /llvm/lib/Demangle/ItaniumDemangle.cpp | |
parent | 3406bb674814109e4b7459d6152e4483ca9e5ae1 (diff) | |
download | bcm5719-llvm-c38cd326fcd7a62cf188a1c0beb5af47ced8b2ac.tar.gz bcm5719-llvm-c38cd326fcd7a62cf188a1c0beb5af47ced8b2ac.zip |
Demangle: avoid butchering parameter type
When demangling a CV-qualified function type with a final parameter with
a reference type, we would insert the CV qualification on the parameter
rather than the function, and in the process adjust the insertion point
by one extra, splitting the type name. This avoids doing so, even
though the attribution is still incorrect.
llvm-svn: 292965
Diffstat (limited to 'llvm/lib/Demangle/ItaniumDemangle.cpp')
-rw-r--r-- | llvm/lib/Demangle/ItaniumDemangle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Demangle/ItaniumDemangle.cpp b/llvm/lib/Demangle/ItaniumDemangle.cpp index b078ffee4a5..c7a151bd27f 100644 --- a/llvm/lib/Demangle/ItaniumDemangle.cpp +++ b/llvm/lib/Demangle/ItaniumDemangle.cpp @@ -1665,9 +1665,9 @@ static const char *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] == '&') - p -= 3; - else if (db.names[k].second.back() == '&') p -= 2; + else if (db.names[k].second.back() == '&') + p -= 1; if (cv & 1) { db.names[k].second.insert(p, " const"); p += 6; |