]> gcc.gnu.org Git - gcc.git/commitdiff
re GNATS gcj/108 (Compiler doesn't check access modifiers on interface implementations)
authorAlexandre Petit-Bianco <apbianco@cygnus.com>
Tue, 7 Mar 2000 22:09:56 +0000 (22:09 +0000)
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>
Tue, 7 Mar 2000 22:09:56 +0000 (14:09 -0800)
2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>

* java-tree.h (IS_INIT_CHECKED): New flag.
* check-init.c (check_init): Test and set IS_INIT_CHECKED.
* parse.y (patch_string): Call force_evaluation_order on the
completed string concatenation tree.
* expr.c (force_evaluation_order): Call force_evaluation_order on
        function's arguments too.

(This fixes the Java PR #108:
 http://sourceware.cygnus.com/ml/java-prs/1999-q4/msg00174.html)

From-SVN: r32391

gcc/java/ChangeLog
gcc/java/check-init.c
gcc/java/expr.c
gcc/java/java-tree.h
gcc/java/parse.c
gcc/java/parse.y

index 1620c530ac39ee4ed211d00c8d4d0055abd157da..a125f421baae599b589baf4b00e61e18c82cc4cc 100644 (file)
@@ -1,3 +1,12 @@
+2000-03-07  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * java-tree.h (IS_INIT_CHECKED): New flag.
+       * check-init.c (check_init): Test and set IS_INIT_CHECKED.
+       * parse.y (patch_string): Call force_evaluation_order on the
+       completed string concatenation tree.
+       * expr.c (force_evaluation_order): Call force_evaluation_order on
+        function's arguments too.
+
 Mon Mar  6 18:07:07 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * decl.c (emit_init_test_initialization): Mark KEY as unused.
index 63ee697f02947fbec10a48c3a93ab5eb165f8cfa..36a0f196afae8640aa68178b03c86dddce5b457f 100644 (file)
@@ -611,7 +611,6 @@ check_init (exp, before)
     case FIX_TRUNC_EXPR:
     case INDIRECT_REF:
     case ADDR_EXPR:
-    case SAVE_EXPR:
     case PREDECREMENT_EXPR:
     case PREINCREMENT_EXPR:
     case POSTDECREMENT_EXPR:
@@ -622,6 +621,13 @@ check_init (exp, before)
       exp = TREE_OPERAND (exp, 0);
       goto again;
 
+    case SAVE_EXPR:
+      if (IS_INIT_CHECKED (exp))
+       return;
+      IS_INIT_CHECKED (exp) = 1;
+      exp = TREE_OPERAND (exp, 0);
+      goto again;
+
     case COMPOUND_EXPR:
     case PLUS_EXPR:
     case MINUS_EXPR:
index 4db334d2a3a1e6f6b967745ad74fab3157ad6486..2d569bfb34b4f49094e31eb7f05a8ba771c7f68b 100644 (file)
@@ -2749,7 +2749,7 @@ force_evaluation_order (node)
       for (cmp = NULL_TREE, arg = TREE_OPERAND (node, 1); 
           arg; arg = TREE_CHAIN (arg))
        {
-         tree saved = save_expr (TREE_VALUE (arg));
+         tree saved = save_expr (force_evaluation_order (TREE_VALUE (arg)));
          cmp = (cmp == NULL_TREE ? saved :
                 build (COMPOUND_EXPR, void_type_node, cmp, saved));
          TREE_VALUE (arg) = saved;
index e50bab0b3195d290e3897cadb95c6ea2c6194ad7..950efd464d9eaa11d3e692592e4ed59083afb38f 100644 (file)
@@ -58,6 +58,7 @@ struct JCF;
    5: HAS_BEEN_ALREADY_PARSED_P (in IDENTIFIER_NODE)
       IS_BREAK_STMT_P (in EXPR_WITH_FILE_LOCATION)
       IS_CRAFTED_STRING_BUFFER_P (in CALL_EXPR)
+      IS_INIT_CHECKED (in SAVE_EXPR)
    6: CAN_COMPLETE_NORMALLY (in statement nodes).
 
    Usage of TYPE_LANG_FLAG_?:
@@ -869,6 +870,10 @@ extern tree *type_map;
 /* True if EXPR (a CALL_EXPR in that case) is a crafted StringBuffer */
 #define IS_CRAFTED_STRING_BUFFER_P(EXPR) TREE_LANG_FLAG_5 (EXPR)
 
+/* True if EXPR (a SAVE_EXPR in that case) had its content already
+   checked for (un)initialized local variables.  */
+#define IS_INIT_CHECKED(EXPR) TREE_LANG_FLAG_5 (EXPR)
+
 /* If set in CALL_EXPR, the receiver is 'super'. */
 #define CALL_USING_SUPER(EXPR) TREE_LANG_FLAG_4 (EXPR)
 
index 532513029a6115cfae9c1e1f4fcf4edee18b7741..c01910138bd334acf6b7897d58a869a71c035589 100644 (file)
@@ -12963,6 +12963,8 @@ patch_string (node)
       /* Temporary disable forbid the use of `this'. */
       ctxp->explicit_constructor_p = 0;
       ret = java_complete_tree (make_qualified_primary (node, invoke, 0));
+      /* String concatenation arguments must be evaluated in order too. */
+      ret = force_evaluation_order (ret);
       /* Restore it at its previous value */
       ctxp->explicit_constructor_p = saved;
       return ret;
index 1fb2175bfa4c32b2b42729e91c0d9f6489402273..2196968a5f39f6ffa560a2ef1131e5dfc19055f2 100644 (file)
@@ -10273,6 +10273,8 @@ patch_string (node)
       /* Temporary disable forbid the use of `this'. */
       ctxp->explicit_constructor_p = 0;
       ret = java_complete_tree (make_qualified_primary (node, invoke, 0));
+      /* String concatenation arguments must be evaluated in order too. */
+      ret = force_evaluation_order (ret);
       /* Restore it at its previous value */
       ctxp->explicit_constructor_p = saved;
       return ret;
This page took 0.105224 seconds and 5 git commands to generate.