Skip to content

Commit bd67468

Browse files
committed
Check that a FileSpec has a Directory component before using
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.
1 parent 8a46728 commit bd67468

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lldb/source/Core/SourceManager.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static inline bool is_newline_char(char ch) { return ch == '\n' || ch == '\r'; }
5151

5252
static void resolve_tilde(FileSpec &file_spec) {
5353
if (!FileSystem::Instance().Exists(file_spec) &&
54+
file_spec.GetDirectory() &&
5455
file_spec.GetDirectory().GetCString()[0] == '~') {
5556
FileSystem::Instance().Resolve(file_spec);
5657
}

0 commit comments

Comments
 (0)