aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-12-06 02:30:11 +0000
committerTom Tromey <tromey@gcc.gnu.org>2005-12-06 02:30:11 +0000
commit45c76dbb43ff77f9d8fd89271033784a9bfbd4c5 (patch)
treea94ad68a1bc363fe0d5f65f9015afcd186f544ff /gcc/java
parent409e35fadcd2c2ce1a20b2813edc0757e170e9ba (diff)
downloadgcc-45c76dbb43ff77f9d8fd89271033784a9bfbd4c5.zip
gcc-45c76dbb43ff77f9d8fd89271033784a9bfbd4c5.tar.gz
gcc-45c76dbb43ff77f9d8fd89271033784a9bfbd4c5.tar.bz2
parse.y (patch_new_array_init): Don't set length on array.
gcc/java: * parse.y (patch_new_array_init): Don't set length on array. libjava: * testsuite/libjava.compile/rh174912.java: New file. From-SVN: r108099
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;