r212468 - Driver: Fix think-o in adding -ivfsoverlay flag to crashdumps

Justin Bogner mail at justinbogner.com
Mon Jul 7 10:34:40 PDT 2014


Author: bogner
Date: Mon Jul  7 12:34:40 2014
New Revision: 212468

URL: http://llvm.org/viewvc/llvm-project?rev=212468&view=rev
Log:
Driver: Fix think-o in adding -ivfsoverlay flag to crashdumps

If there isn't a VFS to overlay we shouldn't be adding a -ivfsoverlay
flag.

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=212468&r1=212467&r2=212468&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Mon Jul  7 12:34:40 2014
@@ -550,9 +550,11 @@ void Driver::generateCompilationDiagnost
         E = I + OldFilename.size();
         I = Cmd.rfind(" ", I) + 1;
         Cmd.replace(I, E - I, NewFilename.data(), NewFilename.size());
-        // Add the VFS overlay to the reproduction script.
-        I += NewFilename.size();
-        Cmd.insert(I, std::string(" -ivfsoverlay ") + VFS.c_str());
+        if (!VFS.empty()) {
+          // Add the VFS overlay to the reproduction script.
+          I += NewFilename.size();
+          Cmd.insert(I, std::string(" -ivfsoverlay ") + VFS.c_str());
+        }
         ScriptOS << Cmd;
         Diag(clang::diag::note_drv_command_failed_diag_msg) << Script;
       }





More information about the cfe-commits mailing list