Debugger: Fix potential crash.

VariablesView:
- Check to ensure the stack frame actually does have a function
  object associated with it before attempting to use it, as this
  isn't always the case.
This commit is contained in:
Rene Gollent
2014-11-09 09:36:54 -05:00
parent d9e931526c
commit 743d5dbeb5
@@ -2839,7 +2839,14 @@ VariablesView::_AddExpressionNode(ExpressionInfo* info)
void
VariablesView::_RestoreExpressionNodes()
{
FunctionID* id = fStackFrame->Function()->GetFunctionID();
FunctionInstance* instance = fStackFrame->Function();
if (instance == NULL)
return;
FunctionID* id = instance->GetFunctionID();
if (id == NULL)
return;
BReference<FunctionID> idReference(id, true);
ExpressionInfoEntry* entry = fExpressions->Lookup(FunctionKey(id));
@@ -2858,7 +2865,14 @@ void
VariablesView::_SetExpressionNodeValue(ExpressionInfo* info, status_t result,
Value* value)
{
FunctionID* id = fStackFrame->Function()->GetFunctionID();
FunctionInstance* instance = fStackFrame->Function();
if (instance == NULL)
return;
FunctionID* id = instance->GetFunctionID();
if (id == NULL)
return;
BReference<FunctionID> idReference(id, true);
ExpressionInfoEntry* entry = fExpressions->Lookup(FunctionKey(id));