[llvm-branch-commits] [lldb] release/22.x: [lldb] Fix crash when there is no compile unit. (#177278) (PR #177351)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Jan 22 04:37:09 PST 2026
https://github.com/llvmbot created https://github.com/llvm/llvm-project/pull/177351
Backport 088f88d6fd4047c52266b92eba5ca60782a69ba1
Requested by: @da-viper
>From 20e8fc56a36475ca945ece033a7b8ae352bfc873 Mon Sep 17 00:00:00 2001
From: Ebuka Ezike <yerimyah1 at gmail.com>
Date: Thu, 22 Jan 2026 12:29:52 +0000
Subject: [PATCH] [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)
---
lldb/source/ValueObject/DILEval.cpp | 3 +++
1 file changed, 3 insertions(+)
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);
More information about the llvm-branch-commits
mailing list