From 0ef8d7621cf691560ed83b3eabf8a7dd89dd5bc6 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Wed, 24 Nov 1993 00:11:19 +0000 Subject: [PATCH] (save_def_or_dec): If function's aux info doesn't end with a closeparen, ignore it. (save_def_or_dec): If function's aux info doesn't end with a closeparen, ignore it. (xmalloc, xrealloc): Cast result of malloc. From-SVN: r6152 --- gcc/protoize.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gcc/protoize.c b/gcc/protoize.c index dc3c2ff4f05..5cff35de671 100644 --- a/gcc/protoize.c +++ b/gcc/protoize.c @@ -611,7 +611,7 @@ xmalloc (byte_count) { pointer_type rv; - rv = malloc (byte_count); + rv = (pointer_type) malloc (byte_count); if (rv == NULL) { fprintf (stderr, "\n%s: virtual memory exceeded\n", pname); @@ -631,7 +631,7 @@ xrealloc (old_space, byte_count) { pointer_type rv; - rv = realloc (old_space, byte_count); + rv = (pointer_type) realloc (old_space, byte_count); if (rv == NULL) { fprintf (stderr, "\n%s: virtual memory exceeded\n", pname); @@ -1710,11 +1710,18 @@ save_def_or_dec (l, is_syscalls) def_dec_p->ansi_decl = dupnstr (ansi_start, (size_t) ((semicolon_p+1) - ansi_start)); - } - /* Backup and point at the final right paren of the final argument list. */ + /* Backup and point at the final right paren of the final argument list. */ + + p--; - p--; + while (p != ansi_start && (p[-1] == ' ' || p[-1] == '\t')) p--; + if (p[-1] != ')') + { + free_def_dec (def_dec_p); + return; + } + } /* Now isolate a whole set of formal argument lists, one-by-one. Normally, there will only be one list to isolate, but there could be more. */ -- 2.30.2