diff options
author | Tom Tromey <tromey@cygnus.com> | 2000-04-28 00:21:06 +0000 |
---|---|---|
committer | Tom Tromey <tromey@cygnus.com> | 2000-04-28 00:21:06 +0000 |
commit | 1b522fd30ecc6cfc399378bfeaf314bbc96d4572 (patch) | |
tree | 8b68598e702242c042747ef9d9b00aed4e7d7ab0 /gcc/java/decl.c | |
parent | f3fae11e7aecb71304ce3317686bfd43fc498e4f (diff) |
Fix for PR gcj/2:
* expr.c (expand_invoke): Generate check to see if object pointer
is null in nonvirtual invocation case.
* java-tree.h (soft_nullpointer_node): Declare.
* decl.c (soft_nullpointer_node): New global.
(init_decl_processing): Initialize soft_nullpointer_node.
* parse.y (invocation_mode): Return INVOKE_NONVIRTUAL for `final'
or `private' methods.
(patch_invoke): Handle INVOKE_NONVIRTUAL case.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@33495 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r-- | gcc/java/decl.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c index 659d4196838..385a8aa03ff 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -375,6 +375,7 @@ tree soft_newarray_node; tree soft_anewarray_node; tree soft_multianewarray_node; tree soft_badarrayindex_node; +tree soft_nullpointer_node; tree throw_node [2]; tree soft_checkarraystore_node; tree soft_monitorenter_node; @@ -813,6 +814,15 @@ init_decl_processing () TREE_THIS_VOLATILE (soft_badarrayindex_node) = 1; TREE_SIDE_EFFECTS (soft_badarrayindex_node) = 1; + soft_nullpointer_node + = builtin_function ("_Jv_ThrowNullPointerException", + build_function_type (void_type_node, endlink), + 0, NOT_BUILT_IN, NULL_PTR); + /* Mark soft_nullpointer_node as a `noreturn' function with side + effects. */ + TREE_THIS_VOLATILE (soft_nullpointer_node) = 1; + TREE_SIDE_EFFECTS (soft_nullpointer_node) = 1; + t = tree_cons (NULL_TREE, class_ptr_type, tree_cons (NULL_TREE, object_ptr_type_node, endlink)); soft_checkcast_node |