Author: Med Ismail Bennani
Date: 2022-02-25T18:33:31-08:00
New Revision: 2dc6e906b09deb092c15a726c06d0ecbeec1eb18

URL: 
https://github.com/llvm/llvm-project/commit/2dc6e906b09deb092c15a726c06d0ecbeec1eb18
DIFF: 
https://github.com/llvm/llvm-project/commit/2dc6e906b09deb092c15a726c06d0ecbeec1eb18.diff

LOG: [lldb/Host] Fix crash in FileSystem::IsLocal

This checks `m_fs` before dereferencing it to access its`isLocal` method.

rdar://67410058

Signed-off-by: Med Ismail Bennani <medismail.benn...@gmail.com>

Added: 
    

Modified: 
    lldb/source/Host/common/FileSystem.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/common/FileSystem.cpp 
b/lldb/source/Host/common/FileSystem.cpp
index 1e4a24abe3017..26a98fa0a4ec4 100644
--- a/lldb/source/Host/common/FileSystem.cpp
+++ b/lldb/source/Host/common/FileSystem.cpp
@@ -192,7 +192,8 @@ bool FileSystem::IsDirectory(const FileSpec &file_spec) 
const {
 
 bool FileSystem::IsLocal(const Twine &path) const {
   bool b = false;
-  m_fs->isLocal(path, b);
+  if (m_fs)
+    m_fs->isLocal(path, b);
   return b;
 }
 


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to