diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-31 11:43:43 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-03-31 11:43:43 +0000 |
commit | 7e6a29a64f1a34de8ece6aa944edbd2bc58e76fc (patch) | |
tree | 8bf22cfbf415d9728bf595db481e2380c8f33e95 /gcc/java/class.c | |
parent | b5ec8c7609bd15ab33ddd219df9dbc5a6d8ddc7c (diff) | |
download | gcc-7e6a29a64f1a34de8ece6aa944edbd2bc58e76fc.tar.gz |
2006-03-30 Andrew Haley <aph@redhat.com>
PR java/26858
* lang.c (java_attribute_table): New.
(LANG_HOOKS_ATTRIBUTE_TABLE): Define.
* expr.c (build_field_ref): Add a null pointer check for all
fields of offset > 4k. Don't do so for accesses via the this
pointer, which we know can never be null.
* class.c (build_java_method_type): Mark arg 1 of all nonstatic
methods nonnull.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112574 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r-- | gcc/java/class.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c index bce16779b75..a6074518f59 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -681,7 +681,17 @@ build_java_method_type (tree fntype, tree this_class, int access_flags) { if (access_flags & ACC_STATIC) return fntype; - return build_method_type (this_class, fntype); + fntype = build_method_type (this_class, fntype); + + /* We know that arg 1 of every nonstatic method is non-null; tell + the back-end so. */ + TYPE_ATTRIBUTES (fntype) = (tree_cons + (get_identifier ("nonnull"), + tree_cons (NULL_TREE, + build_int_cst (NULL_TREE, 1), + NULL_TREE), + TYPE_ATTRIBUTES (fntype))); + return fntype; } tree |