diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-07 19:54:52 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-07 19:54:52 +0000 |
| commit | 0f0b626f4587c53834843a8eac2336f43b575253 (patch) | |
| tree | d57cd7f984505d1ae8545ffaec1be8b2c0b910ab /gcc/java | |
| parent | 0f624b7e174001b1bb9d03ab7decda758fac6a41 (diff) | |
| download | ppe42-gcc-0f0b626f4587c53834843a8eac2336f43b575253.tar.gz ppe42-gcc-0f0b626f4587c53834843a8eac2336f43b575253.zip | |
2001-04-06 Tom Tromey <tromey@redhat.com>
Alexandre Petit-Bianco <apbianco@redhat.com>
Fix for PR gcj/1404 and PR gcj/2332:
* parse.y (build_array_from_name): If we use the type_wfl then
accumulate dimensions from the original type as well.
(build_unresolved_array_type): Don't modify TYPE_OR_WFL in place.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41178 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
| -rw-r--r-- | gcc/java/ChangeLog | 8 | ||||
| -rw-r--r-- | gcc/java/parse.y | 17 |
2 files changed, 22 insertions, 3 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 453641b915e..6fa18d7d7da 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,4 +1,12 @@ 2001-04-06 Tom Tromey <tromey@redhat.com> + Alexandre Petit-Bianco <apbianco@redhat.com> + + Fix for PR gcj/1404 and PR gcj/2332: + * parse.y (build_array_from_name): If we use the type_wfl then + accumulate dimensions from the original type as well. + (build_unresolved_array_type): Don't modify TYPE_OR_WFL in place. + +2001-04-06 Tom Tromey <tromey@redhat.com> * parse.y (analyze_clinit_body): Return true if the second operand of a METHOD_EXPR is nonzero. diff --git a/gcc/java/parse.y b/gcc/java/parse.y index c0b9100ad05..5bddc104a21 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -3255,6 +3255,8 @@ build_array_from_name (type, type_wfl, name, ret_name) /* If we have, then craft a new type for this variable */ if (more_dims) { + tree save = type; + name = get_identifier (&string [more_dims]); /* If we have a pointer, use its type */ @@ -3273,7 +3275,14 @@ build_array_from_name (type, type_wfl, name, ret_name) is already an array on an unresolved type, and we just keep on adding dimensions) */ else if (type_wfl) - type = type_wfl; + { + int i = 0; + type = type_wfl; + string = IDENTIFIER_POINTER (TYPE_NAME (save)); + while (string[i] == '[') + ++i; + more_dims += i; + } /* Add all the dimensions */ while (more_dims--) @@ -3313,8 +3322,10 @@ build_unresolved_array_type (type_or_wfl) IDENTIFIER_POINTER (EXPR_WFL_NODE (type_or_wfl)), IDENTIFIER_LENGTH (EXPR_WFL_NODE (type_or_wfl))); ptr = obstack_finish (&temporary_obstack); - EXPR_WFL_NODE (type_or_wfl) = get_identifier (ptr); - return type_or_wfl; + return build_expr_wfl (get_identifier (ptr), + EXPR_WFL_FILENAME (type_or_wfl), + EXPR_WFL_LINENO (type_or_wfl), + EXPR_WFL_COLNO (type_or_wfl)); } static void |

