expr.c (expand_invoke): Don't generate null pointer check if we're calling <init>.

* expr.c (expand_invoke): Don't generate null pointer check if
	we're calling <init>.

From-SVN: r51487
This commit is contained in:
Tom Tromey 2002-03-27 23:12:05 +00:00 committed by Tom Tromey
parent e4dbaed54e
commit 39bea3744d
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2002-03-27 Tom Tromey <tromey@redhat.com>
* expr.c (expand_invoke): Don't generate null pointer check if
we're calling <init>.
2002-03-27 Neil Booth <neil@daikokuya.demon.co.uk>
* expr.c (java_lang_expand_expr): Rename java_expand_expr,

View File

@ -2129,12 +2129,13 @@ expand_invoke (opcode, method_ref_index, nargs)
method's `this'. In other cases we just rely on an
optimization pass to eliminate redundant checks. FIXME:
Unfortunately there doesn't seem to be a way to determine
what the current method is right now. */
what the current method is right now.
We do omit the check if we're calling <init>. */
/* We use a SAVE_EXPR here to make sure we only evaluate
the new `self' expression once. */
tree save_arg = save_expr (TREE_VALUE (arg_list));
TREE_VALUE (arg_list) = save_arg;
check = java_check_reference (save_arg, 1);
check = java_check_reference (save_arg, ! DECL_INIT_P (method));
func = build_known_method_ref (method, method_type, self_type,
method_signature, arg_list);
}