diff options
-rw-r--r-- | gcc/java/constants.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/java/constants.c b/gcc/java/constants.c index 6d4ad2f..8eb9f54 100644 --- a/gcc/java/constants.c +++ b/gcc/java/constants.c @@ -190,13 +190,16 @@ find_methodref_index (cpool, decl) CPool *cpool; tree decl; { - int class_index = find_class_constant (cpool, DECL_CONTEXT (decl)); + tree mclass = DECL_CONTEXT (decl); + int class_index = find_class_constant (cpool, mclass); tree name = DECL_CONSTRUCTOR_P (decl) ? init_identifier_node : DECL_NAME (decl); int name_type_index = find_name_and_type_constant (cpool, name, TREE_TYPE (decl)); - /* Methodref or INterfacemethodRef - FIXME */ - return find_constant1 (cpool, CONSTANT_Methodref, + return find_constant1 (cpool, + CLASS_INTERFACE (TYPE_NAME (mclass)) + ? CONSTANT_InterfaceMethodref + : CONSTANT_Methodref, (class_index << 16) | name_type_index); } |