diff options
| author | Enrico Granata <egranata@apple.com> | 2012-08-02 17:34:05 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2012-08-02 17:34:05 +0000 |
| commit | df31a8aed70b51acc47429f5833aa7e1e0c1ff2c (patch) | |
| tree | 227542c9bc185a2229f8e7006083526033b60533 /lldb/source/Core | |
| parent | 637c467528c1af4d8873f161667a5b01d1662ea9 (diff) | |
| download | bcm5719-llvm-df31a8aed70b51acc47429f5833aa7e1e0c1ff2c.tar.gz bcm5719-llvm-df31a8aed70b51acc47429f5833aa7e1e0c1ff2c.zip | |
<rdar://problem/11846023> Fixing a bug where malformed DWARF could lead to an endless recursion with synthetic children
llvm-svn: 161185
Diffstat (limited to 'lldb/source/Core')
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 9fc3a0f7f8e..87f72551ffe 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -2020,7 +2020,9 @@ ValueObject::GetSyntheticExpressionPathChild(const char* expression, bool can_cr { // We haven't made a synthetic array member for expression yet, so // lets make one and cache it for any future reference. - synthetic_child_sp = GetValueForExpressionPath(expression); + synthetic_child_sp = GetValueForExpressionPath(expression, + NULL, NULL, NULL, + GetValueForExpressionPathOptions().DontAllowSyntheticChildren()); // Cache the value if we got one back... if (synthetic_child_sp.get()) @@ -2486,10 +2488,14 @@ ValueObject::GetValueForExpressionPath_Impl(const char* expression_cstr, else if (options.m_no_synthetic_children == false) // let's try with synthetic children { if (root->IsSynthetic()) - child_valobj_sp = root; - else - child_valobj_sp = root->GetSyntheticValue(); - + { + *first_unparsed = expression_cstr; + *reason_to_stop = ValueObject::eExpressionPathScanEndReasonNoSuchChild; + *final_result = ValueObject::eExpressionPathEndResultTypeInvalid; + return ValueObjectSP(); + } + + child_valobj_sp = root->GetSyntheticValue(); if (child_valobj_sp.get()) child_valobj_sp = child_valobj_sp->GetChildMemberWithName(child_name, true); } @@ -2524,6 +2530,14 @@ ValueObject::GetValueForExpressionPath_Impl(const char* expression_cstr, } else if (options.m_no_synthetic_children == false) // let's try with synthetic children { + if (root->IsSynthetic()) + { + *first_unparsed = expression_cstr; + *reason_to_stop = ValueObject::eExpressionPathScanEndReasonNoSuchChild; + *final_result = ValueObject::eExpressionPathEndResultTypeInvalid; + return ValueObjectSP(); + } + child_valobj_sp = root->GetSyntheticValue(true); if (child_valobj_sp) child_valobj_sp = child_valobj_sp->GetChildMemberWithName(child_name, true); |

