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 c++/99479] [modules] ICE Aborted signal terminated program cc1plus
Date: Thu, 07 Apr 2022 20:10:15 +0000	[thread overview]
Message-ID: <bug-99479-4-mY43RhxLc2@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99479-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #22 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:7e7a96f774ed892e5cef53fcb68297cd0d513820

commit r12-8051-g7e7a96f774ed892e5cef53fcb68297cd0d513820
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Apr 7 16:09:52 2022 -0400

    c++: use after free during name lookup w/ modules [PR99479]

    name_lookup::search_unqualified uses a statically allocated vector
    in order to avoid repeated reallocation, under the assumption that
    the function can't be called recursively.  With modules however,
    this assumption turns out to be false, and search_unqualified can
    be called recursively as demonstrated by the testcase in comment #19
    of PR99479[1] where the recursive call causes the vector to get
    reallocated which invalidates the reference to queue[ix] held by the
    parent call.

    This patch makes search_unqualified instead use an auto_vec with 16
    elements of internal storage.  In turn we can simplify the API of some
    member functions to take the vector by reference and return void.

    [1]: https://gcc.gnu.org/PR99479#c19

            PR c++/99479

    gcc/cp/ChangeLog:

            * name-lookup.cc (name_lookup::using_queue): Change to an
            auto_vec (with 16 elements of internal storage).
            (name_lookup::queue_namespace): Change return type to void,
            take queue parameter by reference and adjust function body
            accordingly.
            (name_lookup::do_queue_usings): Inline into ...
            (name_lookup::queue_usings): ... here.  As in queue_namespace.
            (name_lookup::search_unqualified): Don't make queue static,
            remove length variable, and adjust function body accordingly.

  parent reply	other threads:[~2022-04-07 20:10 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09  7:37 [Bug c++/99479] New: " alexander.lelyakin at googlemail dot com
2021-03-11  8:16 ` [Bug c++/99479] " alexander.lelyakin at googlemail dot com
2021-03-12 10:18 ` alexander.lelyakin at googlemail dot com
2021-03-23  8:48 ` alexander.lelyakin at googlemail dot com
2021-03-23 20:11 ` alexander.lelyakin at googlemail dot com
2021-03-24 19:44 ` alexander.lelyakin at googlemail dot com
2021-03-27  6:44 ` alexander.lelyakin at googlemail dot com
2021-03-30  1:25 ` mpolacek at gcc dot gnu.org
2021-03-30  6:43 ` alexander.lelyakin at googlemail dot com
2021-04-16 18:51 ` alexander.lelyakin at googlemail dot com
2021-04-16 18:53 ` alexander.lelyakin at googlemail dot com
2021-12-30 16:09 ` pinskia at gcc dot gnu.org
2021-12-30 16:10 ` pinskia at gcc dot gnu.org
2021-12-30 16:11 ` pinskia at gcc dot gnu.org
2021-12-30 16:12 ` pinskia at gcc dot gnu.org
2021-12-30 16:12 ` pinskia at gcc dot gnu.org
2021-12-30 16:12 ` pinskia at gcc dot gnu.org
2021-12-30 21:34 ` pinskia at gcc dot gnu.org
2021-12-31  4:13 ` pinskia at gcc dot gnu.org
2021-12-31  4:20 ` pinskia at gcc dot gnu.org
2022-01-01  4:09 ` pinskia at gcc dot gnu.org
2022-01-24 15:52 ` ppalka at gcc dot gnu.org
2022-01-24 17:56 ` pinskia at gcc dot gnu.org
2022-04-07 20:10 ` cvs-commit at gcc dot gnu.org [this message]
2022-10-20 12:57 ` LpSolit at gmail dot com

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-99479-4-mY43RhxLc2@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).