Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbsupport: Remove some use after move instances
Date: Wed, 24 Jun 2026 08:57:05 -0300	[thread overview]
Message-ID: <e852d30b-c6dd-4d5f-8a33-d19ab9abf312@redhat.com> (raw)
In-Reply-To: <9f13ec54-880e-436b-845d-05b914178e37@simark.ca>

On 6/23/26 5:30 PM, Simon Marchi wrote:
>
> On 2026-06-23 16:21, Guinevere Larsen wrote:
>> A static analysis tool was ran on GDB and pointed out some instances of
>> "use after move" in GDB. The instances that could be easily removed
>> are related to move constructors for exceptions, that were using the
>> parameter's reason in an assert, when they could instead just use their
>> own internal "reason" member.
> I think it's useful to name the tool and if possible paste one example of
> such warning.  That can help if someone needs to dig into that change
> later (or even when reviewing).

Right, makes sense. For completeness on the mailing list, the tool was 
Coverity (I think), and the failure is the following:

Error: USE_AFTER_MOVE (CWE-457):
gdb-17.1/gdbsupport/common-exceptions.h:281:7: move: "ex" is moved 
(indicated by "std::move(ex)").
gdb-17.1/gdbsupport/common-exceptions.h:283:5: use_after_move: "ex" is 
used after it has been already moved.
#  281|       : gdb_exception (std::move (ex))
#  282|     {
#  283|->     gdb_assert (ex.reason == RETURN_ERROR);
#  284|     }
#  285|   };

> But otherwise this LGTM.
>
> Approved-By: Simon Marchi <simon.marchi@efficios.com>
>
> Simon
>

-- 
Cheers,
Guinevere Larsen
it/its
she/her (deprecated)


      reply	other threads:[~2026-06-24 11:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 20:21 Guinevere Larsen
2026-06-23 20:30 ` Simon Marchi
2026-06-24 11:57   ` Guinevere Larsen [this message]

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=e852d30b-c6dd-4d5f-8a33-d19ab9abf312@redhat.com \
    --to=guinevere@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    /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