diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 0e03b880670..868ff717acf 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +Mon Apr 12 18:27:32 1999 Alexandre Petit-Bianco + + * 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. diff --git a/gcc/java/parse.c b/gcc/java/parse.c index ed25b16ab74..1dd713c0490 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -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 diff --git a/gcc/java/parse.y b/gcc/java/parse.y index ef87024de07..efa0912a1a8 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -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