forked from OSchip/llvm-project
Work in progress for:
rdar://problem/10577182 Audit lldb API impl for places where we need to perform a NULL check Add a NULL check for SBValue.CreateValueFromExpression(). llvm-svn: 146954
This commit is contained in:
parent
0ffc31c55b
commit
50660440a1
|
@ -392,8 +392,11 @@ SBValue::CreateValueFromExpression (const char *name, const char* expression)
|
|||
true, // keep in memory
|
||||
eNoDynamicValues,
|
||||
result_valobj_sp);
|
||||
result_valobj_sp->SetName(ConstString(name));
|
||||
result = SBValue(result_valobj_sp);
|
||||
if (result_valobj_sp)
|
||||
{
|
||||
result_valobj_sp->SetName(ConstString(name));
|
||||
result = SBValue(result_valobj_sp);
|
||||
}
|
||||
}
|
||||
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
|
||||
if (log)
|
||||
|
|
|
@ -130,6 +130,10 @@ class ChangeValueAPITestCase(TestBase):
|
|||
self.assertTrue (error.Success(), "Got a changed value for sp")
|
||||
self.assertTrue (actual_value == 1, "Got the right changed value for sp.")
|
||||
|
||||
# Boundary condition test the SBValue.CreateValueFromExpression() API.
|
||||
# LLDB should not crash!
|
||||
nosuchval = mine_value.CreateValueFromExpression(None, None)
|
||||
|
||||
process.Continue()
|
||||
|
||||
self.assertTrue(process.GetState() == lldb.eStateStopped)
|
||||
|
|
Loading…
Reference in New Issue