aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/parse.y8
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index d7b9c97..22b1387 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2005-12-05 Tom Tromey <tromey@redhat.com>
+
+ * parse.y (patch_new_array_init): Don't set length on array.
+
2005-12-02 Richard Guenther <rguenther@suse.de>
* java-gimplify.c (java_gimplify_labeled_block_expr): Use
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 555541c..0a1d8e2 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -14857,8 +14857,12 @@ patch_new_array_init (tree type, tree node)
/* Create a new type. We can't reuse the one we have here by
patching its dimension because it originally is of dimension -1
- hence reused by gcc. This would prevent triangular arrays. */
- type = build_java_array_type (element_type, length);
+ hence reused by gcc. This would prevent triangular arrays.
+ Note that we don't pass the length here. If we do that then the
+ length will end up in the signature of this type, and hence in
+ the signature of the anonymous constructor -- but this is not a
+ valid java signature. */
+ type = build_java_array_type (element_type, -1);
TREE_TYPE (init) = TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (type))));
TREE_TYPE (node) = promote_type (type);
TREE_CONSTANT (init) = all_constant;