]> granicus.if.org Git - clang/commitdiff
Driver: protect from empty -L args
authorMartell Malone <martellmalone@gmail.com>
Thu, 26 Nov 2015 01:02:07 +0000 (01:02 +0000)
committerMartell Malone <martellmalone@gmail.com>
Thu, 26 Nov 2015 01:02:07 +0000 (01:02 +0000)
Differential Revision: http://reviews.llvm.org/D12466

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254117 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChain.cpp

index 8cba13f04e3fbd90cc9b20ee5239788da7461f9c..cbbd485a9b77b7aa6512e1deb7121ca9bce94824 100644 (file)
@@ -619,7 +619,8 @@ void ToolChain::AddCXXStdlibLibArgs(const ArgList &Args,
 void ToolChain::AddFilePathLibArgs(const ArgList &Args,
                                    ArgStringList &CmdArgs) const {
   for (const auto &LibPath : getFilePaths())
-    CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
+    if(LibPath.length() > 0)
+      CmdArgs.push_back(Args.MakeArgString(StringRef("-L") + LibPath));
 }
 
 void ToolChain::AddCCKextLibArgs(const ArgList &Args,