Author: Ebuka Ezike
Date: 2026-01-27T08:00:24Z
New Revision: d9bcebb7a2c78d423046379ca3bdbe0cc90b27db

URL: 
https://github.com/llvm/llvm-project/commit/d9bcebb7a2c78d423046379ca3bdbe0cc90b27db
DIFF: 
https://github.com/llvm/llvm-project/commit/d9bcebb7a2c78d423046379ca3bdbe0cc90b27db.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.

(cherry picked from commit 088f88d6fd4047c52266b92eba5ca60782a69ba1)

Added: 
    

Modified: 
    lldb/source/ValueObject/DILEval.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/ValueObject/DILEval.cpp 
b/lldb/source/ValueObject/DILEval.cpp
index f4b7f783d7b71..b437657d4ade3 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);


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

Reply via email to