summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-01 06:41:11 +0000
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>2000-06-01 06:41:11 +0000
commitfee53a1d4261b26725e008bdbd0f262044b59486 (patch)
tree10f0fa48c74f35965f2825944978cba6a95ee828
parent31e56fea77548042de07bcd1704385ec0c06940e (diff)
downloadppe42-gcc-fee53a1d4261b26725e008bdbd0f262044b59486.tar.gz
ppe42-gcc-fee53a1d4261b26725e008bdbd0f262044b59486.zip
2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
* jcf-write.c (generate_bytecode_insns): At invokation time, always relate an interface method to the type of its selector. (Fix to the PR #71: http://sourceware.cygnus.com/ml/java-prs/1999-q4/msg00040.html) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34330 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/jcf-write.c13
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index f9b405ff0e6..9fdc4f0ed52 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -304,6 +304,11 @@ Thu Apr 20 18:20:58 2000 Jason Schroeder <shrode@subnature.com>
(patch_binop): New temp `cn'. Call patch_string on LHS/RHS of
the `==' and `!=' operators.
+2000-04-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * jcf-write.c (generate_bytecode_insns): At invokation time,
+ always relate an interface method to the type of its selector.
+
2000-04-05 Tom Tromey <tromey@cygnus.com>
Fix for PR gcj/2:
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index ac3b42ee82a..1dcebae43cf 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -2534,8 +2534,8 @@ generate_bytecode_insns (exp, target, state)
NOTE_POP (1); /* Pop implicit this. */
if (TREE_CODE (f) == FUNCTION_DECL && DECL_CONTEXT (f) != NULL_TREE)
{
- int index = find_methodref_index (&state->cpool, f);
- int interface = 0;
+ tree saved_context;
+ int index, interface = 0;
RESERVE (5);
if (METHOD_STATIC (f))
OP1 (OPCODE_invokestatic);
@@ -2549,6 +2549,15 @@ generate_bytecode_insns (exp, target, state)
}
else
OP1 (OPCODE_invokevirtual);
+ if (interface)
+ {
+ saved_context = DECL_CONTEXT (f);
+ DECL_CONTEXT (f) =
+ TREE_TYPE (TREE_TYPE (TREE_VALUE (TREE_OPERAND (exp, 1))));
+ }
+ index = find_methodref_index (&state->cpool, f);
+ if (interface)
+ DECL_CONTEXT (f) = saved_context;
OP2 (index);
f = TREE_TYPE (TREE_TYPE (f));
if (TREE_CODE (f) != VOID_TYPE)
OpenPOWER on IntegriCloud