public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/67046] [10/11/12/13 Regression] Segmentation fault when a preprocessor directive follows the argument to _Pragma
Date: Mon, 13 Mar 2023 13:08:47 +0000	[thread overview]
Message-ID: <bug-67046-4-NUgiLaNQ3r@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-67046-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67046

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Lewis Hyatt <lhyatt@gcc.gnu.org>:

https://gcc.gnu.org/g:336ce497fb266268a79544f00dd3bbd24cf3a4d6

commit r13-6631-g336ce497fb266268a79544f00dd3bbd24cf3a4d6
Author: Lewis Hyatt <lhyatt@gmail.com>
Date:   Sat Jan 14 13:29:22 2023 -0500

    libcpp: Fix ICE on directive inside _Pragma() operator [PR67046]

    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.

  parent reply	other threads:[~2023-03-13 13:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 21:34 [Bug preprocessor/67046] New: " dsabogal.ufl at gmail dot com
2021-12-06  5:30 ` [Bug preprocessor/67046] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
2022-01-17 15:18 ` rguenth at gcc dot gnu.org
2022-05-27  9:35 ` [Bug preprocessor/67046] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:31 ` jakub at gcc dot gnu.org
2023-01-13 22:36 ` lhyatt at gcc dot gnu.org
2023-01-17 18:01 ` lhyatt at gcc dot gnu.org
2023-03-13 13:08 ` cvs-commit at gcc dot gnu.org [this message]
2023-03-13 13:09 ` lhyatt at gcc dot gnu.org

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=bug-67046-4-NUgiLaNQ3r@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).