public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Tamar Christina <Tamar.Christina@arm.com>
Cc: Mikael Morin <morin-mikael@orange.fr>,
	 Richard Earnshaw <Richard.Earnshaw@arm.com>,
	 "gcc-patches\@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	 nd <nd@arm.com>
Subject: Re: [PATCH v2] machine descriptor: New compact syntax for insn and insn_split in Machine Descriptions.
Date: Thu, 15 Jun 2023 07:24:26 +0100	[thread overview]
Message-ID: <mptedmdckf9.fsf@arm.com> (raw)
In-Reply-To: <mptttv9de6v.fsf@arm.com> (Richard Sandiford's message of "Wed, 14 Jun 2023 20:41:28 +0100")

Richard Sandiford <richard.sandiford@arm.com> writes:
>> +
>> +         /* Skip any newlines or whitespaces needed.  */
>> +         while (ISSPACE(*templ))
>> +           templ++;
>> +         continue;
>> +       }
>> +      else if (templ[0] == '/' && templ[1] == '*')
>> +       {
>> +         templ += 2;
>> +         /* Glob till newline or end of multiline comment.  */
>> +         while (templ[0] != 0 && templ[0] != '*' && templ[1] != '/')
>> +           templ++;
>> +         templ += 2;
>
> Same problem about moving past '\0' here.  But the break condition would
> stop on things like "*]" or "//", not just "*/".  I think it should be:
>
>    for (; templ[0] != 0; ++templ)
>      if (templ[0] == '*' && templ[1] == '/')
>        {
>          templ += 2;
>          break;
>        }

Actually, I guess it should be:

   while (templ[0] != '*' || templ[1] != '/')
     {
       if (templ[0] == 0)
         fatal_at (loc, "unterminated '/*'");
       templ++;
     }
   templ += 2;

so that we don't accept unterminated /*.

Thanks,
Richard

      reply	other threads:[~2023-06-15  6:24 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-18 16:30 [PATCH] RFC: " Tamar Christina
2023-04-21 17:18 ` Richard Sandiford
2023-04-24  8:33   ` Richard Sandiford
2023-05-16 13:56     ` Richard Earnshaw (lists)
2023-04-24  9:05   ` Tamar Christina
2023-04-24  9:37     ` Richard Sandiford
2023-06-05 13:51 ` [PATCH v2] machine descriptor: " Tamar Christina
2023-06-05 20:35 ` Richard Sandiford
2023-06-06  7:47   ` Richard Sandiford
2023-06-06 12:00   ` Tamar Christina
2023-06-06 12:49     ` Richard Sandiford
2023-06-06 16:13       ` Richard Earnshaw (lists)
2023-06-08  9:58         ` Tamar Christina
2023-06-08 10:12           ` Andreas Schwab
2023-06-08 10:29             ` Richard Earnshaw (lists)
2023-06-08 10:33               ` Richard Earnshaw (lists)
2023-06-08 14:24           ` Richard Sandiford
2023-06-08 16:49           ` Mikael Morin
2023-06-13 15:26             ` Tamar Christina
2023-06-14 19:41               ` Richard Sandiford
2023-06-15  6:24                 ` Richard Sandiford [this message]

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=mptedmdckf9.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=Tamar.Christina@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=morin-mikael@orange.fr \
    --cc=nd@arm.com \
    /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).