diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 742f7026464f0..5c79d758bafd7 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -731,6 +731,10 @@ may even involve JITing and running code in the target program.)"); valobj_sp = frame->GetValueForVariableExpressionPath( entry.ref(), m_varobj_options.use_dynamic, expr_path_options, var_sp, error); + // Check only the `error` argument, because doing + // `valobj_sp->GetError()` will update the value and potentially + // return a new error that happens during the update, even if + // `GetValueForVariableExpressionPath` reported no errors. if (valobj_sp && error.Success()) { result.GetValueObjectList().Append(valobj_sp); @@ -770,10 +774,6 @@ may even involve JITing and running code in the target program.)"); break; } if (!found_recognized) { - // Check only the `error` argument, because doing - // `valobj_sp->GetError()` will update the value and potentially - // return a new error that happens during the update, even if - // `GetValueForVariableExpressionPath` reported no errors. if (error.Fail()) result.SetError(error.takeError()); else