aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-06-22 20:34:56 -0600
committerTom Tromey <tom@tromey.com>2023-06-22 20:36:09 -0600
commit8a269c262e3d0611c01edd915f230bbd2ad78015 (patch)
tree361da25a0ecfe75f05c97f604533a65e521bf57d /gdb
parent52aa69594247ade96e444ae72d17d648f9915821 (diff)
downloadgdb-8a269c262e3d0611c01edd915f230bbd2ad78015.zip
gdb-8a269c262e3d0611c01edd915f230bbd2ad78015.tar.gz
gdb-8a269c262e3d0611c01edd915f230bbd2ad78015.tar.bz2
Fix off-by-one error
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ax-general.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index 3c724a0..26a27a0 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;
}