aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2001-01-09 09:30:43 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2001-01-09 09:30:43 +0000
commit4b49c3657f581b4f484f7dd380d174a95449cdd1 (patch)
tree6a914eec78331aa78c3ba5cf75eb5831f611cb32 /gcc/cppmacro.c
parentbad48d7ebd711c4e79d6ae31602c9fb805d2d5b7 (diff)
downloadgcc-4b49c3657f581b4f484f7dd380d174a95449cdd1.zip
gcc-4b49c3657f581b4f484f7dd380d174a95449cdd1.tar.gz
gcc-4b49c3657f581b4f484f7dd380d174a95449cdd1.tar.bz2
cppinit.c (cpp_cleanup): NULLify macro_buffer and zero macro_buffer_len.
* cppinit.c (cpp_cleanup): NULLify macro_buffer and zero macro_buffer_len. * cppmacro.c (cpp_macro_definition): Reset macro_buffer_len when realloc()ing macro_buffer. From-SVN: r38821
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r--gcc/cppmacro.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index 8af9fab..1539552 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -1,6 +1,6 @@
/* Part of CPP library. (Macro and #define handling.)
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
@@ -1568,7 +1568,10 @@ cpp_macro_definition (pfile, node)
}
if (len > pfile->macro_buffer_len)
- pfile->macro_buffer = (U_CHAR *) xrealloc (pfile->macro_buffer, len);
+ {
+ pfile->macro_buffer = (U_CHAR *) xrealloc (pfile->macro_buffer, len);
+ pfile->macro_buffer_len = len;
+ }
buffer = pfile->macro_buffer;
/* Parameter names. */