diff options
Diffstat (limited to 'gcc/java/parse.c')
-rw-r--r-- | gcc/java/parse.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/java/parse.c b/gcc/java/parse.c index c019101..59a1b5a 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -11771,6 +11771,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)) { @@ -11850,7 +11854,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. */ @@ -13516,9 +13520,11 @@ patch_newarray (node) for (cdim = dims; cdim; cdim = TREE_CHAIN (cdim)) { type = array_type; - array_type = build_java_array_type (type, - TREE_CODE (cdim) == INTEGER_CST ? - TREE_INT_CST_LOW (cdim) : -1); + array_type + = build_java_array_type (type, + TREE_CODE (cdim) == INTEGER_CST + ? (HOST_WIDE_INT) TREE_INT_CST_LOW (cdim) + : -1); array_type = promote_type (array_type); } dims = nreverse (dims); |