Ran the static analyzer on the codebase and found a few things.

llvm-svn: 160338
This commit is contained in:
Greg Clayton
2012-07-17 03:23:13 +00:00
parent 24a8378c4f
commit 23f59509a8
42 changed files with 544 additions and 641 deletions

View File

@@ -2344,8 +2344,10 @@ ValueObject::GetValuesForExpressionPath(const char* expression,
ValueObjectSP final_value = ret_val->Dereference(error);
if (error.Fail() || !final_value.get())
{
*reason_to_stop = ValueObject::eExpressionPathScanEndReasonDereferencingFailed;
*final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
if (reason_to_stop)
*reason_to_stop = ValueObject::eExpressionPathScanEndReasonDereferencingFailed;
if (final_value_type)
*final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
return 0;
}
else
@@ -2361,8 +2363,10 @@ ValueObject::GetValuesForExpressionPath(const char* expression,
ValueObjectSP final_value = ret_val->AddressOf(error);
if (error.Fail() || !final_value.get())
{
*reason_to_stop = ValueObject::eExpressionPathScanEndReasonTakingAddressFailed;
*final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
if (reason_to_stop)
*reason_to_stop = ValueObject::eExpressionPathScanEndReasonTakingAddressFailed;
if (final_value_type)
*final_value_type = ValueObject::eExpressionPathEndResultTypeInvalid;
return 0;
}
else
@@ -3770,9 +3774,9 @@ ValueObject::EvaluationPoint::SyncWithProcessState()
if (current_mod_id.GetStopID() == 0)
return false;
bool changed;
if (m_mod_id.IsValid())
bool changed = false;
const bool was_valid = m_mod_id.IsValid();
if (was_valid)
{
if (m_mod_id == current_mod_id)
{
@@ -3804,6 +3808,7 @@ ValueObject::EvaluationPoint::SyncWithProcessState()
{
// We used to have a frame, but now it is gone
SetInvalid();
changed = was_valid;
}
}
}
@@ -3811,6 +3816,7 @@ ValueObject::EvaluationPoint::SyncWithProcessState()
{
// We used to have a thread, but now it is gone
SetInvalid();
changed = was_valid;
}
}