parse.y (patch_unaryop): Fix ++ operator check on array references.
authorAlexandre Petit-Bianco <apbianco@cygnus.com>
Mon, 12 Apr 1999 18:32:22 +0000 (18:32 +0000)
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>
Mon, 12 Apr 1999 18:32:22 +0000 (11:32 -0700)
Mon Apr 12 18:27:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
* parse.y (patch_unaryop): Fix ++ operator check on array
  references.

From-SVN: r26382

gcc/java/ChangeLog
gcc/java/parse.c
gcc/java/parse.y

index 0e03b880670e1ed9cf274be01c877eb03a6096bd..868ff717acf300775ddcb2b7a98e5afe9bf9cc82 100644 (file)
@@ -1,3 +1,8 @@
+Mon Apr 12 18:27:32 1999  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * parse.y (patch_unaryop): Fix ++ operator check on array
+       references.
+
 Tue Apr  6 23:15:52 1999  Jeffrey A Law  (law@cygnus.com)
 
        * Makefile.in (TREE_H): Add tree-check.h.
index ed25b16ab7462d99fbd0cb774a0bbe21d9048672..1dd713c04908c825087916934ebaa5a08974cf11 100644 (file)
@@ -12344,9 +12344,12 @@ patch_unaryop (node, wfl_op)
     case PREDECREMENT_EXPR:
       decl = strip_out_static_field_access_decl (op);
       if (!JDECL_P (decl) 
-         && !((TREE_CODE (decl) == INDIRECT_REF 
-               || TREE_CODE (decl) == COMPONENT_REF) 
-              && JPRIMITIVE_TYPE_P (TREE_TYPE (decl))))
+         && TREE_CODE (decl) != COMPONENT_REF
+         && !(flag_emit_class_files && TREE_CODE (decl) == ARRAY_REF)
+         && TREE_CODE (decl) != INDIRECT_REF
+         && !(TREE_CODE (decl) == COMPOUND_EXPR
+              && TREE_OPERAND (decl, 1)
+              && (TREE_CODE (TREE_OPERAND (decl, 1)) == INDIRECT_REF)))
        {
          tree lvalue;
          /* Before screaming, check that we're not in fact trying to
index ef87024de070c7e90a40de3f370fb5df4ab34951..efa0912a1a80207879ab436a6a38e53e3581e3c0 100644 (file)
@@ -9742,10 +9742,14 @@ patch_unaryop (node, wfl_op)
       /* 15.14.2 Prefix Decrement Operator -- */
     case PREDECREMENT_EXPR:
       decl = strip_out_static_field_access_decl (op);
+      /* We really should have a JAVA_ARRAY_EXPR to avoid this */
       if (!JDECL_P (decl) 
-         && !((TREE_CODE (decl) == INDIRECT_REF 
-               || TREE_CODE (decl) == COMPONENT_REF) 
-              && JPRIMITIVE_TYPE_P (TREE_TYPE (decl))))
+         && TREE_CODE (decl) != COMPONENT_REF
+         && !(flag_emit_class_files && TREE_CODE (decl) == ARRAY_REF)
+         && TREE_CODE (decl) != INDIRECT_REF
+         && !(TREE_CODE (decl) == COMPOUND_EXPR
+              && TREE_OPERAND (decl, 1)
+              && (TREE_CODE (TREE_OPERAND (decl, 1)) == INDIRECT_REF)))
        {
          tree lvalue;
          /* Before screaming, check that we're not in fact trying to