diff options
| author | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-09 09:30:43 +0000 |
|---|---|---|
| committer | aoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-09 09:30:43 +0000 |
| commit | 8744fb7e072e53244dbe421424b27e4079fa8d60 (patch) | |
| tree | 6a914eec78331aa78c3ba5cf75eb5831f611cb32 | |
| parent | 69f720eca0e1cefe4d8b0b35c55de0896dfb229d (diff) | |
| download | ppe42-gcc-8744fb7e072e53244dbe421424b27e4079fa8d60.tar.gz ppe42-gcc-8744fb7e072e53244dbe421424b27e4079fa8d60.zip | |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38821 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/cppinit.c | 6 | ||||
| -rw-r--r-- | gcc/cppmacro.c | 7 |
3 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 81bb3f80b17..5bc2e8a1b2f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2001-01-09 Alexandre Oliva <aoliva@redhat.com> + * 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. + * hwint.h (HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Use long long if it's wider than long and the target's long is wider than the host's. diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 12844d9ac91..44e10c830b6 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -570,7 +570,11 @@ cpp_cleanup (pfile) cpp_pop_buffer (pfile); if (pfile->macro_buffer) - free ((PTR) pfile->macro_buffer); + { + free ((PTR) pfile->macro_buffer); + pfile->macro_buffer = NULL; + pfile->macro_buffer_len = 0; + } deps_free (pfile->deps); diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c index 8af9fab52ff..1539552076b 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. */ |

