public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Kahlert <martin.kahlert@infineon.com>
To: Bryce McKinlay <bryce@waitaki.otago.ac.nz>
Cc: java@gcc.gnu.org, java-patches@gcc.gnu.org
Subject: Re: Infinitely long compilation
Date: Wed, 27 Mar 2002 23:55:00 -0000	[thread overview]
Message-ID: <20020328085507.A20623@keksy.muc.infineon.com> (raw)
In-Reply-To: <3CA2C261.3080409@waitaki.otago.ac.nz>; from bryce@waitaki.otago.ac.nz on Thu, Mar 28, 2002 at 07:12:33PM +1200

Hi Bryce,
turned out that the problem was fast to find out.
I do not know, how to make this patch correct in the gcc-way,
but it works for me. The problem is this:

If you have a name foo.bar you replace it by foo@bar,
try that for an identifier and then change the name back to foo.bar.
If it was not an identifier, do the same again....

Perhaps the line
*separator = c;
could simply be left out, but i do not know, whether the original name
will be used later. So i made the changes on a private copy.

Thanks for your help,
Martin.


PS: The patch is against gcc-20020325.

2002-03-28  Martin Kahlert  <martin.kahlert@infineon.com>

	* parse.y (do_resolve_class): Fix infinite recursion

--- parse.y.old	Thu Mar 28 08:33:56 2002
+++ parse.y	Thu Mar 28 08:50:42 2002
@@ -5852,18 +5852,22 @@
      applicable and use the matching DECL instead. */
   if (!decl_result && QUALIFIED_P (TYPE_NAME (class_type)))
     {
+      char *namebuffer;
+
       tree name = TYPE_NAME (class_type);
+
+      namebuffer = alloca(strlen(IDENTIFIER_POINTER (name))+1);
+      strcpy(namebuffer, IDENTIFIER_POINTER (name));
+
       char *separator;
       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);

-- 
The early bird catches the worm. If you want something else for       
breakfast, get up later.

  parent reply	other threads:[~2002-03-28  7:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-27 22:45 Martin Kahlert
2002-03-27 23:12 ` Bryce McKinlay
2002-03-27 23:19   ` Martin Kahlert
2002-03-27 23:34     ` Bryce McKinlay
2002-03-28  0:16       ` Martin Kahlert
2002-03-27 23:55   ` Martin Kahlert [this message]
2002-03-29 14:17     ` Alexandre Petit-Bianco

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020328085507.A20623@keksy.muc.infineon.com \
    --to=martin.kahlert@infineon.com \
    --cc=bryce@waitaki.otago.ac.nz \
    --cc=java-patches@gcc.gnu.org \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).