aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/class.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2006-03-31 11:43:43 +0000
committerAndrew Haley <aph@gcc.gnu.org>2006-03-31 11:43:43 +0000
commite6b7893e348494a1fe572cc149d5044998d55a19 (patch)
tree8bf22cfbf415d9728bf595db481e2380c8f33e95 /gcc/java/class.c
parent9ef47dec918a7b32927f240581d9418981050170 (diff)
downloadgcc-e6b7893e348494a1fe572cc149d5044998d55a19.zip
gcc-e6b7893e348494a1fe572cc149d5044998d55a19.tar.gz
gcc-e6b7893e348494a1fe572cc149d5044998d55a19.tar.bz2
re PR libgcj/26858 (NullPointerException not generated for large classes...)
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. From-SVN: r112574
Diffstat (limited to 'gcc/java/class.c')
-rw-r--r--gcc/java/class.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/java/class.c b/gcc/java/class.c
index bce1677..a607451 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