Author: Ebuka Ezike
Date: 2026-01-22T12:29:52Z
New Revision: 088f88d6fd4047c52266b92eba5ca60782a69ba1

URL: 
https://github.com/llvm/llvm-project/commit/088f88d6fd4047c52266b92eba5ca60782a69ba1
DIFF: 
https://github.com/llvm/llvm-project/commit/088f88d6fd4047c52266b92eba5ca60782a69ba1.diff

LOG: [lldb] Fix crash when there is no compile unit. (#177278)

The crash occurred in lldb-dap when we are in a shared library with no
debug information and we are trying to get the expression path for an
address.

Added: 
    

Modified: 
    lldb/source/ValueObject/DILEval.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/ValueObject/DILEval.cpp 
b/lldb/source/ValueObject/DILEval.cpp
index 68a2a228962fb..5ffebc107bfb3 100644
--- a/lldb/source/ValueObject/DILEval.cpp
+++ b/lldb/source/ValueObject/DILEval.cpp
@@ -50,6 +50,9 @@ GetTypeSystemFromCU(std::shared_ptr<ExecutionContextScope> 
ctx) {
     return llvm::createStringError("no stack frame in this context");
   SymbolContext symbol_context =
       stack_frame->GetSymbolContext(lldb::eSymbolContextCompUnit);
+
+  if (!symbol_context.comp_unit)
+    return llvm::createStringError("no compile unit in this context");
   lldb::LanguageType language = symbol_context.comp_unit->GetLanguage();
 
   symbol_context = stack_frame->GetSymbolContext(lldb::eSymbolContextModule);


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to