diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-26 20:09:24 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-26 20:09:24 +0000 |
commit | ccb428bb04adaa909431d6e929b8f9e6bdbe7208 (patch) | |
tree | 1e8014536371f74d71d706903f32132ba70e6ac3 /lib/Driver/Driver.cpp | |
parent | 485717e8e43034d653ccd7f35f4546773e016e27 (diff) |
[driver] Before applying the working directory check if the input path
is absolute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index 31492a7b6d..43e9e5d69f 100644 --- a/lib/Driver/Driver.cpp +++ b/lib/Driver/Driver.cpp @@ -1018,8 +1018,8 @@ void Driver::BuildInputs(const ToolChain &TC, const DerivedArgList &Args, if (CheckInputsExist && memcmp(Value, "-", 2) != 0) { SmallString<64> Path(Value); if (Arg *WorkDir = Args.getLastArg(options::OPT_working_directory)) { - SmallString<64> Directory(WorkDir->getValue(Args)); - if (llvm::sys::path::is_absolute(Directory.str())) { + if (!llvm::sys::path::is_absolute(Path.str())) { + SmallString<64> Directory(WorkDir->getValue(Args)); llvm::sys::path::append(Directory, Value); Path.assign(Directory); } |