aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-12-09 05:14:19 +0000
committerTom Tromey <tromey@gcc.gnu.org>2001-12-09 05:14:19 +0000
commit5fcab23524cf4b0d797bdaa403d12e71966c69a2 (patch)
treecc5699d46e8fc436aec3fdbdba9b175fb86af3cd /gcc/java
parent7b35f6c94ff5ec2fd0b3563646b74271976f3b91 (diff)
downloadgcc-5fcab23524cf4b0d797bdaa403d12e71966c69a2.zip
gcc-5fcab23524cf4b0d797bdaa403d12e71966c69a2.tar.gz
gcc-5fcab23524cf4b0d797bdaa403d12e71966c69a2.tar.bz2
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
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog3
-rw-r--r--gcc/java/gjavah.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index f04ebf2..30e730f 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,5 +1,8 @@
2001-12-08 Tom Tromey <tromey@redhat.com>
+ * 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 7248775..1e93dde 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));