From 636cd262d6ae996e76faba51e24eccb603e7e42f Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Fri, 24 Jul 2015 00:57:19 +0000 Subject: Fix an issue where LLDB would run out of stack space trying to decide if a deeply nested child can be updated in the face of an invalid execution context The issue is that a child can't really ask the root object, since this decision could actually hinge on whether a dynamic and/or synthetic value is present To do this, make values vote lazily for whether they are willing to allow this, so that we can navigate up the chain without recursively invoking ourselves Tentative fix for rdar://21949558 llvm-svn: 243077 --- lldb/source/Core/ValueObjectChild.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lldb/source/Core/ValueObjectChild.cpp') diff --git a/lldb/source/Core/ValueObjectChild.cpp b/lldb/source/Core/ValueObjectChild.cpp index c1e45e1f48d..06c311f22cf 100644 --- a/lldb/source/Core/ValueObjectChild.cpp +++ b/lldb/source/Core/ValueObjectChild.cpp @@ -109,12 +109,14 @@ ValueObjectChild::GetDisplayTypeName() return display_name; } -bool +LazyBool ValueObjectChild::CanUpdateWithInvalidExecutionContext () { - if (m_parent) - return m_parent->CanUpdateWithInvalidExecutionContext(); - return this->ValueObject::CanUpdateWithInvalidExecutionContext(); + ValueObject* opinionated_ancestor = FollowParentChain([] (ValueObject* vo) -> bool { + return (vo->CanUpdateWithInvalidExecutionContext() == eLazyBoolCalculate); + }); + + return opinionated_ancestor ? opinionated_ancestor->CanUpdateWithInvalidExecutionContext() : this->ValueObject::CanUpdateWithInvalidExecutionContext(); } bool -- cgit v1.2.3