diff options
| author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-08 13:52:39 +0000 |
|---|---|---|
| committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-08 13:52:39 +0000 |
| commit | f39bebdba144115c82f60bfb9cead2243f7861fa (patch) | |
| tree | fce2e1ab440f686a57534e6eac2bcc137e816805 /gcc/java/expr.c | |
| parent | 92ee73b27e8d2ae3645a7fcb101b3e27fa255722 (diff) | |
| download | ppe42-gcc-f39bebdba144115c82f60bfb9cead2243f7861fa.tar.gz ppe42-gcc-f39bebdba144115c82f60bfb9cead2243f7861fa.zip | |
2005-12-08 Andrew Haley <aph@redhat.com>
* java-tree.h (enum java_tree_index): Add JTI_SOFT_NOSUCHFIELD_NODE.
(soft_abstractmethod_node): New.
* expr.c (build_field_ref): Add in-line check for missing field.
* decl.c (java_init_decl_processing): Add soft_nosuchfield_node.
2005-12-08 Andrew Haley <aph@redhat.com>
* java/lang/Object.h (throwNoSuchMethodError): New method.
* java/lang/Object.java (throwNoSuchMethodError): New method.
* include/jvm.h (_Jv_ThrowNoSuchFieldError): Declare.
* link.cc (_Jv_ThrowNoSuchFieldError): New.
(link_symbol_table): Don't throw a NoSuchFieldError if a field is
missing. Instead, set the otable entry to zero.
(link_symbol_table): If we don't find a nonstatic method, insert
the vtable offset of Object.throwNoSuchMethodError() into the
otable.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108230 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/expr.c')
| -rw-r--r-- | gcc/java/expr.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 81bd6fac180..e7b299245a1 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -1703,6 +1703,17 @@ build_field_ref (tree self_value, tree self_class, tree name) NULL_TREE, NULL_TREE); tree address; + if (DECL_CONTEXT (field_decl) != output_class) + field_offset + = build3 (COND_EXPR, TREE_TYPE (field_offset), + build2 (EQ_EXPR, boolean_type_node, + field_offset, integer_zero_node), + build3 (CALL_EXPR, void_type_node, + build_address_of (soft_nosuchfield_node), + build_tree_list (NULL_TREE, otable_index), + NULL_TREE), + field_offset); + field_offset = fold (convert (sizetype, field_offset)); address = fold_build2 (PLUS_EXPR, |

