From 1beb00db1f5197efb73f839da681b8e439f37628 Mon Sep 17 00:00:00 2001 From: Daniel Sanders Date: Mon, 3 Aug 2020 16:53:41 -0700 Subject: [PATCH] Fix use-after-scope in 7209f83112db caught by the sanitizer bots --- clang/lib/Driver/Driver.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(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