aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorMartin Kahlert <martin.kahlert@infineon.com>2002-03-29 22:27:29 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2002-03-29 14:27:29 -0800
commit5bebbee7338bb2f91e0348a9d963ee85ecabfb9a (patch)
treebf889058ac1cb4d2d7bb049a4470f5e07f17da20 /gcc/java
parentbc3a44dbcad809b3e9a94153627db6079fe90794 (diff)
downloadgcc-5bebbee7338bb2f91e0348a9d963ee85ecabfb9a.zip
gcc-5bebbee7338bb2f91e0348a9d963ee85ecabfb9a.tar.gz
gcc-5bebbee7338bb2f91e0348a9d963ee85ecabfb9a.tar.bz2
parse.y (do_resolve_class): Fix infinite recursion.
2002-03-29 Martin Kahlert <martin.kahlert@infineon.com> * parse.y (do_resolve_class): Fix infinite recursion. (http://gcc.gnu.org/ml/java/2002-03/msg00654.html) From-SVN: r51578
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog4
-rw-r--r--gcc/java/parse.y12
2 files changed, 11 insertions, 5 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 5adea4c..c66f9a6 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,7 @@
+2002-03-29 Martin Kahlert <martin.kahlert@infineon.com>
+
+ * parse.y (do_resolve_class): Fix infinite recursion.
+
2002-03-29 Tom Tromey <tromey@redhat.com>
* parse.y (check_inner_circular_reference): Ignore incomplete
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 6dccb3b..ef18d5f 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -5868,18 +5868,20 @@ do_resolve_class (enclosing, class_type, decl, cl)
applicable and use the matching DECL instead. */
if (!decl_result && QUALIFIED_P (TYPE_NAME (class_type)))
{
- tree name = TYPE_NAME (class_type);
char *separator;
+ tree name = TYPE_NAME (class_type);
+ char *namebuffer = alloca (IDENTIFIER_LENGTH (name) + 1);
+
+ strcpy (namebuffer, IDENTIFIER_POINTER (name));
+
do {
/* Reach the last '.', and if applicable, replace it by a `$' and
see if this exists as a type. */
- if ((separator = strrchr (IDENTIFIER_POINTER (name), '.')))
+ if ((separator = strrchr (namebuffer, '.')))
{
- int c = *separator;
*separator = '$';
- name = get_identifier (IDENTIFIER_POINTER (name));
- *separator = c;
+ name = get_identifier (namebuffer);
decl_result = IDENTIFIER_CLASS_VALUE (name);
}
} while (!decl_result && separator);