From 32ef44088fd9d91fc64cce325f37caccab0b83f6 Mon Sep 17 00:00:00 2001 From: rms Date: Wed, 24 Nov 1993 19:33:10 +0000 Subject: [PATCH] (save_def_or_dec): Correct typo in change of Nov 23. Make sure pointers within def_dec_p are valid before it is freed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6156 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/protoize.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gcc/protoize.c b/gcc/protoize.c index 5cff35d..f3b1307 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -1715,8 +1715,12 @@ save_def_or_dec (l, is_syscalls) p--; +#ifndef UNPROTOIZE + def_dec_p->f_list_chain = NULL; +#endif /* !defined (UNPROTOIZE) */ + while (p != ansi_start && (p[-1] == ' ' || p[-1] == '\t')) p--; - if (p[-1] != ')') + if (*p != ')') { free_def_dec (def_dec_p); return; @@ -1728,10 +1732,6 @@ save_def_or_dec (l, is_syscalls) def_dec_p->f_list_count = 0; -#ifndef UNPROTOIZE - def_dec_p->f_list_chain = NULL; -#endif /* !defined (UNPROTOIZE) */ - for (;;) { const char *left_paren_p = find_corresponding_lparen (p); -- 2.7.4