public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb: use frame_id_p instead of comparing to null_frame_id in frame_info_ptr::reinflate
Date: Thu, 10 Nov 2022 16:34:11 +0000 (GMT)	[thread overview]
Message-ID: <20221110163411.0AEB23858D1E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=45eca9d9f36985672cb2303b4ea0b3c855961c1d

commit 45eca9d9f36985672cb2303b4ea0b3c855961c1d
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Mon Oct 24 16:16:09 2022 -0400

    gdb: use frame_id_p instead of comparing to null_frame_id in frame_info_ptr::reinflate
    
    The assertion
    
        gdb_assert (m_cached_id != null_frame_id);
    
    is always true, as comparing equal to null_frame_id is always false
    (it's the first case in frame_id::operator==, not sure why it's not this
    way, but that's what it is).
    
    Replace the comparison with a call to frame_id_p.
    
    Approved-By: Tom Tromey <tom@tromey.com>
    Change-Id: I93986e6a85ac56353690792552e5b3b4cedec7fb

Diff:
---
 gdb/frame-info.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/frame-info.c b/gdb/frame-info.c
index 84791205d90..584222dc490 100644
--- a/gdb/frame-info.c
+++ b/gdb/frame-info.c
@@ -39,7 +39,7 @@ frame_info_ptr::prepare_reinflate ()
 void
 frame_info_ptr::reinflate ()
 {
-  gdb_assert (m_cached_id != null_frame_id);
+  gdb_assert (frame_id_p (m_cached_id));
 
   if (m_ptr == nullptr)
     m_ptr = frame_find_by_id (m_cached_id).get ();

                 reply	other threads:[~2022-11-10 16:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221110163411.0AEB23858D1E@sourceware.org \
    --to=simark@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).