Skip to content

Commit

Permalink
Check that a FileSpec has a Directory component before using
Browse files Browse the repository at this point in the history
A follow on to my patch for https://reviews.llvm.org/D126435
hit by an x86_64 linux bot; I assumed that a FileSpec had a
directory component and checked if the first character was a
'~'.  This was not a valid assumption.
  • Loading branch information
jasonmolenda committed May 26, 2022
1 parent 8a46728 commit bd67468
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lldb/source/Core/SourceManager.cpp
Expand Up @@ -51,6 +51,7 @@ static inline bool is_newline_char(char ch) { return ch == '\n' || ch == '\r'; }

static void resolve_tilde(FileSpec &file_spec) {
if (!FileSystem::Instance().Exists(file_spec) &&
file_spec.GetDirectory() &&
file_spec.GetDirectory().GetCString()[0] == '~') {
FileSystem::Instance().Resolve(file_spec);
}
Expand Down

0 comments on commit bd67468

Please sign in to comment.