diff options
Diffstat (limited to 'lldb/source/API/SBModule.cpp')
-rw-r--r-- | lldb/source/API/SBModule.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp index 0c1307ccc76..28180fce63a 100644 --- a/lldb/source/API/SBModule.cpp +++ b/lldb/source/API/SBModule.cpp @@ -381,10 +381,8 @@ SBModule::FindGlobalVariables (SBTarget &target, const char *name, uint32_t max_ for (uint32_t i=0; i<match_count; ++i) { lldb::ValueObjectSP valobj_sp; - if (target.IsValid()) - valobj_sp = ValueObjectVariable::Create (target.get(), variable_list.GetVariableAtIndex(i)); - else - valobj_sp = ValueObjectVariable::Create (NULL, variable_list.GetVariableAtIndex(i)); + TargetSP target_sp (target.GetSP()); + valobj_sp = ValueObjectVariable::Create (target_sp.get(), variable_list.GetVariableAtIndex(i)); if (valobj_sp) value_object_list.Append(valobj_sp); } |