From 05ecd0e9ab53c460dd64ea7c2c2403854d244874 Mon Sep 17 00:00:00 2001 From: Philippe De Muyter Date: Wed, 5 Apr 2000 07:15:09 +0200 Subject: [PATCH] cpphash.c (_cpp_free_definition): Test argnames, not nargs >= 0, before freeing argnames. 2000-04-04 Philippe De Muyter * cpphash.c (_cpp_free_definition): Test argnames, not nargs >= 0, before freeing argnames. * cpplib.c (do_ifndef): Cast return value of xstrdup. From-SVN: r32924 --- gcc/ChangeLog | 6 ++++++ gcc/cpphash.c | 2 +- gcc/cpplib.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8c113d23f69..7dbd95ef4e7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2000-04-04 Philippe De Muyter + + * cpphash.c (_cpp_free_definition): Test argnames, not nargs >= 0, + before freeing argnames. + * cpplib.c (do_ifndef): Cast return value of xstrdup. + 2000-04-05 Michael Meissner * config/rs6000/rs6000.c (print_operand): Patch from Jonathan diff --git a/gcc/cpphash.c b/gcc/cpphash.c index 0eadc9a4c94..ac8fbcb27b4 100644 --- a/gcc/cpphash.c +++ b/gcc/cpphash.c @@ -256,7 +256,7 @@ _cpp_free_definition (d) nextap = ap->next; free (ap); } - if (d->nargs >= 0) + if (d->argnames) free (d->argnames); free (d); } diff --git a/gcc/cpplib.c b/gcc/cpplib.c index f097f72c589..b1138537c4a 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -1309,7 +1309,7 @@ do_ifndef (pfile) skip = parse_ifdef (pfile, dtable[T_IFNDEF].name); if (start_of_file && !skip) - control_macro = xstrdup (CPP_PWRITTEN (pfile)); + control_macro = (U_CHAR *) xstrdup (CPP_PWRITTEN (pfile)); conditional_skip (pfile, skip, T_IFNDEF, control_macro); return 0;