diff options
author | Tom Tromey <tromey@redhat.com> | 2002-03-27 23:12:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-03-27 23:12:05 +0000 |
commit | 39bea3744da85789d5587e490c8530b1af2eef15 (patch) | |
tree | 64dd08447f00d061dcf30443f9877d93b560c5c8 /gcc/java/expr.c | |
parent | e4dbaed54ef2f55b52d5926276b891b1535d7c89 (diff) | |
download | gcc-39bea3744da85789d5587e490c8530b1af2eef15.zip gcc-39bea3744da85789d5587e490c8530b1af2eef15.tar.gz gcc-39bea3744da85789d5587e490c8530b1af2eef15.tar.bz2 |
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
Diffstat (limited to 'gcc/java/expr.c')
-rw-r--r-- | gcc/java/expr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/java/expr.c b/gcc/java/expr.c index a251404..895c322 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -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); } |