aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@cygnus.com>2000-03-08 00:30:06 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-03-07 16:30:06 -0800
commit6632dcdd410754a2c25a117cae5fab151b94c6b4 (patch)
tree852a5f51874a3500e5968554fcf9e9bbde1b07f5 /gcc/java/parse.y
parent15f1a7952b44f09f409cbe01d57af82e8d9ffcf6 (diff)
downloadgcc-6632dcdd410754a2c25a117cae5fab151b94c6b4.zip
gcc-6632dcdd410754a2c25a117cae5fab151b94c6b4.tar.gz
gcc-6632dcdd410754a2c25a117cae5fab151b94c6b4.tar.bz2
re GNATS gcj/94 (compiler allows assignment to interface constants)
2000-02-22 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (check_final_assignment): Extended to process COMPOUND_EXPR. (patch_assignment): Have check_final_assignment called only once. (This fixes the Java PR #94: http://sourceware.cygnus.com/ml/java-prs/1999-q4/msg00125.html) From-SVN: r32396
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 2196968..1d8d68b9 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -9081,6 +9081,10 @@ static int
check_final_assignment (lvalue, wfl)
tree lvalue, wfl;
{
+ if (TREE_CODE (lvalue) == COMPOUND_EXPR
+ && JDECL_P (TREE_OPERAND (lvalue, 1)))
+ lvalue = TREE_OPERAND (lvalue, 1);
+
if (JDECL_P (lvalue)
&& FIELD_FINAL (lvalue) && !IS_CLINIT (current_function_decl))
{
@@ -9160,7 +9164,7 @@ patch_assignment (node, wfl_op1, wfl_op2)
else if (TREE_CODE (wfl_op1) == EXPR_WITH_FILE_LOCATION
&& resolve_expression_name (wfl_op1, &llvalue))
{
- if (check_final_assignment (llvalue, wfl_op1))
+ if (!error_found && check_final_assignment (llvalue, wfl_op1))
{
/* What we should do instead is resetting the all the flags
previously set, exchange lvalue for llvalue and continue. */