@@ -650,15 +650,15 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
650
650
Status deref_error;
651
651
if (valobj_sp->GetCompilerType ().IsReferenceType ()) {
652
652
valobj_sp = valobj_sp->GetSyntheticValue ()->Dereference (deref_error);
653
- if (error .Fail ()) {
653
+ if (!valobj_sp || deref_error .Fail ()) {
654
654
error.SetErrorStringWithFormatv (
655
655
" Failed to dereference reference type: %s" , deref_error);
656
656
return ValueObjectSP ();
657
657
}
658
658
}
659
659
660
660
valobj_sp = valobj_sp->Dereference (deref_error);
661
- if (error .Fail ()) {
661
+ if (!valobj_sp || deref_error .Fail ()) {
662
662
error.SetErrorStringWithFormatv (
663
663
" Failed to dereference sythetic value: {0}" , deref_error);
664
664
return ValueObjectSP ();
@@ -793,9 +793,9 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
793
793
// what we have is *ptr[low]. the most similar C++ syntax is to deref
794
794
// ptr and extract bit low out of it. reading array item low would be
795
795
// done by saying ptr[low], without a deref * sign
796
- Status error ;
797
- ValueObjectSP temp (valobj_sp->Dereference (error ));
798
- if (error .Fail ()) {
796
+ Status deref_error ;
797
+ ValueObjectSP temp (valobj_sp->Dereference (deref_error ));
798
+ if (!temp || deref_error .Fail ()) {
799
799
valobj_sp->GetExpressionPath (var_expr_path_strm);
800
800
error.SetErrorStringWithFormat (
801
801
" could not dereference \" (%s) %s\" " ,
@@ -811,9 +811,8 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
811
811
// arr[0] (an operation that is equivalent to deref-ing arr) and
812
812
// extract bit low out of it. reading array item low would be done by
813
813
// saying arr[low], without a deref * sign
814
- Status error;
815
814
ValueObjectSP temp (valobj_sp->GetChildAtIndex (0 ));
816
- if (error. Fail () ) {
815
+ if (!temp ) {
817
816
valobj_sp->GetExpressionPath (var_expr_path_strm);
818
817
error.SetErrorStringWithFormat (
819
818
" could not get item 0 for \" (%s) %s\" " ,
@@ -1001,9 +1000,9 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
1001
1000
// deref ptr and extract bits low thru high out of it. reading array
1002
1001
// items low thru high would be done by saying ptr[low-high], without a
1003
1002
// deref * sign
1004
- Status error ;
1005
- ValueObjectSP temp (valobj_sp->Dereference (error ));
1006
- if (error .Fail ()) {
1003
+ Status deref_error ;
1004
+ ValueObjectSP temp (valobj_sp->Dereference (deref_error ));
1005
+ if (!temp || deref_error .Fail ()) {
1007
1006
valobj_sp->GetExpressionPath (var_expr_path_strm);
1008
1007
error.SetErrorStringWithFormat (
1009
1008
" could not dereference \" (%s) %s\" " ,
@@ -1018,9 +1017,8 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
1018
1017
// get arr[0] (an operation that is equivalent to deref-ing arr) and
1019
1018
// extract bits low thru high out of it. reading array items low thru
1020
1019
// high would be done by saying arr[low-high], without a deref * sign
1021
- Status error;
1022
1020
ValueObjectSP temp (valobj_sp->GetChildAtIndex (0 ));
1023
- if (error. Fail () ) {
1021
+ if (!temp ) {
1024
1022
valobj_sp->GetExpressionPath (var_expr_path_strm);
1025
1023
error.SetErrorStringWithFormat (
1026
1024
" could not get item 0 for \" (%s) %s\" " ,
0 commit comments