From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [pushed] Fix off-by-one error
Date: Thu, 22 Jun 2023 20:36:21 -0600 [thread overview]
Message-ID: <20230623023621.2257026-1-tom@tromey.com> (raw)
Simon pointed out that commit a2bbca9fa5e ("Use std::vector<bool> for
agent_expr::reg_mask") caused a regression in libstdc++ debug mode.
This was due to an off-by-one error in a vector resize. This patch
fixes the problem.
---
gdb/ax-general.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index 3c724a0e38b..26a27a0bcad 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -414,7 +414,7 @@ ax_reg_mask (struct agent_expr *ax, int reg)
/* Grow the bit mask if necessary. */
if (reg >= ax->reg_mask.size ())
- ax->reg_mask.resize (reg);
+ ax->reg_mask.resize (reg + 1);
ax->reg_mask[reg] = true;
}
--
2.39.2
reply other threads:[~2023-06-23 2:36 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=20230623023621.2257026-1-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@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).