Author: Daniel Sanders Date: 2020-08-03T16:55:00-07:00 New Revision: 1beb00db1f5197efb73f839da681b8e439f37628
URL: https://github.com/llvm/llvm-project/commit/1beb00db1f5197efb73f839da681b8e439f37628 DIFF: https://github.com/llvm/llvm-project/commit/1beb00db1f5197efb73f839da681b8e439f37628.diff LOG: Fix use-after-scope in 7209f83112db caught by the sanitizer bots Added: Modified: clang/lib/Driver/Driver.cpp Removed: ################################################################################ diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 35263fbe1b2d..e6a267621d8b 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -4601,12 +4601,12 @@ const char *Driver::GetNamedOutputPath(Compilation &C, const JobAction &JA, } SmallString<128> BasePath(BaseInput); + SmallString<128> ExternalPath(""); StringRef BaseName; // Dsymutil actions should use the full path. if (isa<DsymutilJobAction>(JA) && C.getArgs().hasArg(options::OPT_dsym_dir)) { - SmallString<128> ExternalPath( - C.getArgs().getLastArg(options::OPT_dsym_dir)->getValue()); + ExternalPath += C.getArgs().getLastArg(options::OPT_dsym_dir)->getValue(); // We use posix style here because the tests (specifically // darwin-dsymutil.c) demonstrate that posix style paths are acceptable // even on Windows and if we don't then the similar test covering this _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits