From: Saleem Abdulrasool Date: Tue, 24 Jan 2017 18:52:19 +0000 (+0000) Subject: Demangle: avoid butchering parameter type X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60b4e66e58558c471aa838b6f8ef2cfb6978395f;p=llvm 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292965 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Demangle/ItaniumDemangle.cpp b/lib/Demangle/ItaniumDemangle.cpp index b078ffee4a5..c7a151bd27f 100644 --- a/lib/Demangle/ItaniumDemangle.cpp +++ b/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;