aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index b3bf309..1ef8764 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -895,13 +895,13 @@ typename: TYPENAME
nonempty_typelist
: type
- { $$ = (struct type **)xmalloc (sizeof (struct type *) * 2);
- $$[0] = (struct type *)0;
+ { $$ = (struct type **) xmalloc (sizeof (struct type *) * 2);
+ $<ivec>$[0] = 1; /* Number of types in vector */
$$[1] = $1;
}
| nonempty_typelist ',' type
- { int len = sizeof (struct type *) * ++($<ivec>1[0]);
- $$ = (struct type **)xrealloc ((char *) $1, len);
+ { int len = sizeof (struct type *) * (++($<ivec>1[0]) + 1);
+ $$ = (struct type **) xrealloc ((char *) $1, len);
$$[$<ivec>$[0]] = $3;
}
;