From 5fcab23524cf4b0d797bdaa403d12e71966c69a2 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 9 Dec 2001 05:14:19 +0000 Subject: [PATCH] gjavah.c (decompile_method): Don't decompile to `return this' for static methods. * gjavah.c (decompile_method): Don't decompile to `return this' for static methods. From-SVN: r47804 --- gcc/java/ChangeLog | 3 +++ gcc/java/gjavah.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index f04ebf26daa..30e730fbc2f 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,5 +1,8 @@ 2001-12-08 Tom Tromey + * gjavah.c (decompile_method): Don't decompile to `return this' + for static methods. + * gjavah.c (cxx_keywords): Re-sorted. * lex.c (cxx_keywords): Re-sorted. diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 724877507e0..1e93ddef4a6 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -1065,7 +1065,10 @@ decompile_method (out, jcf, code_len) } else if (code_len == 2 && codes[0] == OPCODE_aload_0 - && codes[1] == OPCODE_areturn) + && codes[1] == OPCODE_areturn + /* We're going to generate `return this'. This only makes + sense for non-static methods. */ + && ! (method_access & ACC_STATIC)) { decompile_return_statement (out, jcf, method_signature, -1, JPOOL_USHORT1 (jcf, jcf->this_class)); -- 2.30.2