From 4b49c3657f581b4f484f7dd380d174a95449cdd1 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 9 Jan 2001 09:30:43 +0000 Subject: 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 --- gcc/cppmacro.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gcc/cppmacro.c') 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. */ -- cgit v1.1