aboutsummaryrefslogtreecommitdiff
path: root/gdb/ch-exp.c
diff options
context:
space:
mode:
authorFred Fish <fnf@specifix.com>1996-02-12 21:03:12 +0000
committerFred Fish <fnf@specifix.com>1996-02-12 21:03:12 +0000
commit6405302d013c9afbbb1fe3390831e9b7879c4d59 (patch)
tree4b6ab4e2ebd3ab59cc0a4b35d6d904a8c88ea32c /gdb/ch-exp.c
parent15ed5f2c3fc4625bba07fb731e7f281286c97fd0 (diff)
downloadgdb-6405302d013c9afbbb1fe3390831e9b7879c4d59.zip
gdb-6405302d013c9afbbb1fe3390831e9b7879c4d59.tar.gz
gdb-6405302d013c9afbbb1fe3390831e9b7879c4d59.tar.bz2
* f-lang.c (allocate_saved_bf_node, allocate_saved_function_node,
allocate_saved_f77_common_node, allocate_common_entry_node, add_common_block): Use xmalloc rather than malloc, some of which were unchecked. * gnu-regex.c: At same point as other gdb specific changes #undef malloc and then #define it to xmalloc. * ch-exp.c (growbuf_by_size): Use xmalloc/xrealloc rather than bare unchecked calls to malloc/realloc. * stabsread.c (dbx_lookup_type): Use xmalloc rather than bare unchecked call to malloc.
Diffstat (limited to 'gdb/ch-exp.c')
-rw-r--r--gdb/ch-exp.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/gdb/ch-exp.c b/gdb/ch-exp.c
index 95021e7..4767d94 100644
--- a/gdb/ch-exp.c
+++ b/gdb/ch-exp.c
@@ -26,15 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
during the process of parsing; the lower levels of the tree always
come first in the result.
- Note that malloc's and realloc's in this file are transformed to
- xmalloc and xrealloc respectively by the same sed command in the
- makefile that remaps any other malloc/realloc inserted by the parser
- generator. Doing this with #defines and trying to control the interaction
- with include files (<malloc.h> and <stdlib.h> for example) just became
- too messy, particularly when such includes can be inserted at random
- times by the parser generator.
-
- Also note that the language accepted by this parser is more liberal
+ Note that the language accepted by this parser is more liberal
than the one accepted by an actual Chill compiler. For example, the
language rule that a simple name string can not be one of the reserved
simple name strings is not enforced (e.g "case" is not treated as a
@@ -1094,11 +1086,11 @@ growbuf_by_size (count)
tempbufsize += growby;
if (tempbuf == NULL)
{
- tempbuf = (char *) malloc (tempbufsize);
+ tempbuf = (char *) xmalloc (tempbufsize);
}
else
{
- tempbuf = (char *) realloc (tempbuf, tempbufsize);
+ tempbuf = (char *) xrealloc (tempbuf, tempbufsize);
}
}