public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Lewis Hyatt <lhyatt@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] libcpp: Fix ICE on directive inside _Pragma() operator [PR67046]
Date: Sat, 11 Mar 2023 10:21:10 -0700	[thread overview]
Message-ID: <44f0b594-0e67-0c04-54c1-5b4a72425282@gmail.com> (raw)
In-Reply-To: <b18279769199fe5019effd045d7999e2992996ad.1673721922.git.lhyatt@gmail.com>



On 1/14/23 11:46, Lewis Hyatt via Gcc-patches wrote:
> get__Pragma_string() in directives.cc is responsible for lexing the parens
> and the string argument from a _Pragma("...") operator. This function does
> not handle the case when the closing paren is not on the same line as the
> string; in that case, libcpp will by default reuse the token buffer it
> previously used for the string, so that the string token returned by
> get__Pragma_string() may be corrupted, as shown in the testcase. Fix using
> the existing keep_tokens mechanism that temporarily disables the reuse of
> token buffers.
> 
> libcpp/ChangeLog:
> 
> 	PR preprocessor/67046
> 	* directives.cc (_cpp_do__Pragma): Increment pfile->keep_tokens to
> 	ensure the returned string token is valid.
> 
> gcc/testsuite/ChangeLog:
> 
> 	PR preprocessor/67046
> 	* c-c++-common/cpp/pr67046.c: New test.
OK for the trunk.

Sorry for the long wait.

jeff

      reply	other threads:[~2023-03-11 17:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-14 18:46 Lewis Hyatt
2023-03-11 17:21 ` Jeff Law [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=44f0b594-0e67-0c04-54c1-5b4a72425282@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=lhyatt@gmail.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).