projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
52aa695
)
Fix off-by-one error
author
Tom Tromey
<tom@tromey.com>
Fri, 23 Jun 2023 02:34:56 +0000
(20:34 -0600)
committer
Tom Tromey
<tom@tromey.com>
Fri, 23 Jun 2023 02:36:09 +0000
(20:36 -0600)
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
patch
|
blob
|
history
diff --git
a/gdb/ax-general.c
b/gdb/ax-general.c
index 3c724a0e38ba24178038fcbc29903fa4ad1f985f..26a27a0bcadc95b6097055c60428f519a5e8bca3 100644
(file)
--- 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;
}