aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-11-22 16:36:02 -0700
committerTom Tromey <tom@tromey.com>2023-12-05 07:17:57 -0700
commit3381781151c60cc70a9fb44856e2dd5611465a73 (patch)
tree3162dbfdd7d5c38268b6c9e780fe48487b7bca58
parentde501587c2ed91b4bc2a3d5228d59f6544427ab9 (diff)
downloadgdb-3381781151c60cc70a9fb44856e2dd5611465a73.zip
gdb-3381781151c60cc70a9fb44856e2dd5611465a73.tar.gz
gdb-3381781151c60cc70a9fb44856e2dd5611465a73.tar.bz2
Fix off-by-one error in compute_delayed_physnames
compute_delayed_physnames does this: size_t len = strlen (physname); ... if (physname[len] == ')') /* shortcut */ break; However, physname[len] will always be \0. This patch changes it to the correct len-1.
-rw-r--r--gdb/dwarf2/read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 9311666..d834870 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -5647,7 +5647,7 @@ compute_delayed_physnames (struct dwarf2_cu *cu)
while (1)
{
- if (physname[len] == ')') /* shortcut */
+ if (physname[len - 1] == ')') /* shortcut */
break;
else if (check_modifier (physname, len, " const"))
TYPE_FN_FIELD_CONST (fn_flp->fn_fields, mi.index) = 1;