[Lldb-commits] [lldb] [LLDB] Detect cycles during Type resolution (PR #200304)
Alex Langford via lldb-commits
lldb-commits at lists.llvm.org
Fri May 29 07:53:11 PDT 2026
================
@@ -584,6 +585,14 @@ bool Type::WriteToMemory(ExecutionContext *exe_ctx, lldb::addr_t addr,
const Declaration &Type::GetDeclaration() const { return m_decl; }
bool Type::ResolveCompilerType(ResolveState compiler_type_resolve_state) {
+ if (m_resolving_compiler_type) {
+ LLDB_LOG(GetLog(LLDBLog::Symbols),
+ "Cycle detected while resolving type {0:x} ({1})", GetID(),
+ m_name.AsCString("<anonymous>"));
+ return false;
+ }
+ llvm::SaveAndRestore<bool> guard(m_resolving_compiler_type, true);
----------------
bulbazord wrote:
Does this code need to be thread-safe? Imagine 2 threads call these where:
1. Thread 1 executes this guard
2. Thread 2 executes the check at the beginning of the method and incorrectly fails.
https://github.com/llvm/llvm-project/pull/200304
More information about the lldb-commits
mailing list