From: Justin Bogner Date: Mon, 7 Jul 2014 17:34:40 +0000 (+0000) Subject: Driver: Fix think-o in adding -ivfsoverlay flag to crashdumps X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b58e15652e1160e5f2b3d0cf39636bae5c69dc1;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212468 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 08dcc11d62..284403306f 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -550,9 +550,11 @@ void Driver::generateCompilationDiagnostics(Compilation &C, 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; }