public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: John Baldwin <jhb@FreeBSD.org>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [PATCH 6/6] Make aop_map 'static'
Date: Tue, 20 Jun 2023 11:12:00 -0600	[thread overview]
Message-ID: <87fs6m2h3z.fsf@tromey.com> (raw)
In-Reply-To: <a020c46d-505c-47f1-907b-8efa54ab61a0@FreeBSD.org> (John Baldwin's message of "Tue, 20 Jun 2023 08:39:31 -0700")

>>>>> "John" == John Baldwin <jhb@FreeBSD.org> writes:

John> Looking around in ax-general.c more, it seems we already do runtime
John> validation of potential indices before indexing the array, so I'm not sure
John> the assertion adds much value and I'd be tempted to remove aop_last entirely.

Yeah, that was my feeling as well.  I've changed this patch to just make
aop_map static, and split out another patch to remove aop_last.

John> BTW, the various other places in ax-general.c that do the assertion are
John> all using the expanded form of ARRAY_SIZE and would be a bit more readable
John> perhaps if they used ARRAY_SIZE instead.

I tacked on a patch to do this.  This caught a bug, one of the checks
was using '>' rather than '>='.

Tom

      reply	other threads:[~2023-06-20 17:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-19 21:06 [PATCH 0/6] C++-ify and simplify agent expressions Tom Tromey
2023-06-19 21:06 ` [PATCH 1/6] Remove mem2hex Tom Tromey
2023-06-19 21:06 ` [PATCH 2/6] Use gdb::byte_vector in agent_expr Tom Tromey
2023-06-19 21:06 ` [PATCH 3/6] Use std::vector<bool> for agent_expr::reg_mask Tom Tromey
2023-06-20 15:30   ` John Baldwin
2023-06-20 17:04     ` Tom Tromey
2023-06-19 21:06 ` [PATCH 4/6] Simplify agent_expr constructor Tom Tromey
2023-06-19 21:06 ` [PATCH 5/6] Use bool for agent_expr::tracing Tom Tromey
2023-06-20 15:31   ` John Baldwin
2023-06-20 17:04     ` Tom Tromey
2023-06-19 21:06 ` [PATCH 6/6] Make aop_map 'static' Tom Tromey
2023-06-20 15:39   ` John Baldwin
2023-06-20 17:12     ` Tom Tromey [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=87fs6m2h3z.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.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).