aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/lang.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/lang.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/lang.c')
-rw-r--r--gcc/java/lang.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index e1f822e..58f23e9 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -108,6 +108,14 @@ const char *const tree_code_name[] = {
};
#undef DEFTREECODE
+/* Table of machine-independent attributes. */
+const struct attribute_spec java_attribute_table[] =
+{
+ { "nonnull", 0, -1, false, true, true,
+ NULL },
+ { NULL, 0, 0, false, false, false, NULL }
+};
+
/* Used to avoid printing error messages with bogus function
prototypes. Starts out false. */
static bool inhibit_error_function_printing;
@@ -213,6 +221,9 @@ struct language_function GTY(())
#undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME
#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME java_mangle_decl
+#undef LANG_HOOKS_ATTRIBUTE_TABLE
+#define LANG_HOOKS_ATTRIBUTE_TABLE java_attribute_table
+
/* Each front end provides its own. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;