From: Jonas Devlieghere Date: Thu, 28 Feb 2019 18:46:04 +0000 (+0000) Subject: [dsymutil] Use rfind for paths with parentheses X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abce0e8bf5ab339e134cf8b821855e1a8bfc52a3;p=llvm [dsymutil] Use rfind for paths with parentheses Dsymutil gets library member information is through the ambiguous /path/to/archive.a(member.o). The current logic we use would get confused by additional parentheses. Using rfind mitigates this issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355114 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/dsymutil/BinaryHolder.cpp b/tools/dsymutil/BinaryHolder.cpp index 9c9672af045..da4ed8abc12 100644 --- a/tools/dsymutil/BinaryHolder.cpp +++ b/tools/dsymutil/BinaryHolder.cpp @@ -21,7 +21,7 @@ namespace dsymutil { static std::pair getArchiveAndObjectName(StringRef Filename) { - StringRef Archive = Filename.substr(0, Filename.find('(')); + StringRef Archive = Filename.substr(0, Filename.rfind('(')); StringRef Object = Filename.substr(Archive.size() + 1).drop_back(); return {Archive, Object}; }