From b8b639c915c46441180e004a8dacc66553c17c24 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 21 Sep 2004 16:28:40 +0000 Subject: [PATCH] re PR java/17575 (gcjh does not clear its function name cache between files) PR java/17575: * gjavah.c (free_method_name_list): New method. (main): Call it. From-SVN: r87812 --- gcc/java/ChangeLog | 6 ++++++ gcc/java/gjavah.c | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index f0311cc5049..255eaaa6bba 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,9 @@ +2004-09-21 Tom Tromey + + PR java/17575: + * gjavah.c (free_method_name_list): New method. + (main): Call it. + 2004-09-17 Jeffrey D. Oldham Zack Weinberg diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 8f53df192ff..d62e585758e 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -636,6 +636,22 @@ name_is_method_p (const unsigned char *name, int length) return 0; } +/* Free the method name list. */ +static void +free_method_name_list () +{ + struct method_name *p = method_name_list; + while (p != NULL) + { + struct method_name *next = p->next; + free (p->name); + free (p->signature); + free (p); + p = next; + } + method_name_list = NULL; +} + /* If there is already a native method named NAME, whose signature is not SIGNATURE, then return true. Otherwise return false. */ static int @@ -2530,6 +2546,7 @@ main (int argc, char** argv) } } } + free_method_name_list (); process_file (&jcf, out); JCF_FINISH (&jcf); if (current_output_file != output_file) -- 2.30.2