forked from OSchip/llvm-project
Fix a use-after-scope from 9902362701
This commit is contained in:
parent
40a6be4346
commit
9091df5fad
|
@ -123,14 +123,14 @@ FileManager::getDirectoryRef(StringRef DirName, bool CacheFailure) {
|
|||
DirName != llvm::sys::path::root_path(DirName) &&
|
||||
llvm::sys::path::is_separator(DirName.back()))
|
||||
DirName = DirName.substr(0, DirName.size()-1);
|
||||
Optional<std::string> DirNameStr;
|
||||
if (is_style_windows(llvm::sys::path::Style::native)) {
|
||||
// Fixing a problem with "clang C:test.c" on Windows.
|
||||
// Stat("C:") does not recognize "C:" as a valid directory
|
||||
std::string DirNameStr;
|
||||
if (DirName.size() > 1 && DirName.back() == ':' &&
|
||||
DirName.equals_insensitive(llvm::sys::path::root_name(DirName))) {
|
||||
DirNameStr = DirName.str() + '.';
|
||||
DirName = DirNameStr;
|
||||
DirName = *DirNameStr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue