]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* expr.c (expand_invoke): Don't generate null pointer check if
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Mar 2002 23:12:05 +0000 (23:12 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Mar 2002 23:12:05 +0000 (23:12 +0000)
we're calling <init>.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51487 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/expr.c

index 58cf198e3da238cd90bf5444cd97fe1155922032..aba8cdb504dbf89794b44cfa47bbcb56d7c25c9f 100644 (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,
index a25140463f3b07196515734d88dc5d383dc7fdc1..895c3221629ba7b0bab035aff2c628cf79d40b8c 100644 (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);
     }