Fix use-after-scope in 7209f83112 caught by the sanitizer bots

This commit is contained in:
Daniel Sanders 2020-08-03 16:53:41 -07:00
parent d879ac8a6e
commit 1beb00db1f
1 changed files with 2 additions and 2 deletions

View File

@ -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