mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
[PathV2]: Fix bug in create_directories which caused infinite recursion on
som inputs. Bug found and fix proposed by Kal Conley! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
98a92d199c
commit
55f43d6b7e
@ -654,12 +654,13 @@ error_code create_directories(const Twine &path, bool &existed) {
|
||||
StringRef p = path.toStringRef(path_storage);
|
||||
|
||||
StringRef parent = path::parent_path(p);
|
||||
if (!parent.empty()) {
|
||||
bool parent_exists;
|
||||
|
||||
if (error_code ec = fs::exists(parent, parent_exists)) return ec;
|
||||
|
||||
if (!parent_exists)
|
||||
if (error_code ec = create_directories(parent, existed)) return ec;
|
||||
}
|
||||
|
||||
return create_directory(p, existed);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user