@@ -511,8 +511,8 @@ void BreakpointLocation::GetDescription(Stream *s,
511511
512512 // If there's a preferred line entry for printing, use that.
513513 bool show_function_info = true ;
514- if (GetPreferredLineEntry ()) {
515- sc.line_entry = *GetPreferredLineEntry () ;
514+ if (auto preferred = GetPreferredLineEntry ()) {
515+ sc.line_entry = *preferred ;
516516 // FIXME: We're going to get the function name wrong when the preferred
517517 // line entry is not the lowest one. For now, just leave the function
518518 // out in this case, but we really should also figure out how to easily
@@ -549,8 +549,8 @@ void BreakpointLocation::GetDescription(Stream *s,
549549 if (sc.line_entry .line > 0 ) {
550550 s->EOL ();
551551 s->Indent (" location = " );
552- if (GetPreferredLineEntry ())
553- GetPreferredLineEntry () ->DumpStopContext (s, true );
552+ if (auto preferred = GetPreferredLineEntry ())
553+ preferred ->DumpStopContext (s, true );
554554 else
555555 sc.line_entry .DumpStopContext (s, true );
556556 }
@@ -672,9 +672,10 @@ void BreakpointLocation::SendBreakpointLocationChangedEvent(
672672}
673673
674674std::optional<uint32_t > BreakpointLocation::GetSuggestedStackFrameIndex () {
675- if (!GetPreferredLineEntry ())
675+ auto preferred_opt = GetPreferredLineEntry ();
676+ if (!preferred_opt)
676677 return {};
677- LineEntry preferred = *GetPreferredLineEntry () ;
678+ LineEntry preferred = *preferred_opt ;
678679 SymbolContext sc;
679680 if (!m_address.CalculateSymbolContext (&sc))
680681 return {};
0 commit comments