public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Marek Polacek <polacek@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: C++ PATCH for c++/90265 - ICE with generic lambda
Date: Mon, 06 May 2019 16:46:00 -0000	[thread overview]
Message-ID: <CADzB+2kasoD0O5v2Qs5qE1w6qXKPNw_2hHNi=+Qc+_+E=z6THg@mail.gmail.com> (raw)
In-Reply-To: <20190506163206.GF4334@redhat.com>

On Mon, May 6, 2019 at 12:32 PM Marek Polacek <polacek@redhat.com> wrote:
>
> This new code
>
>   vec_safe_push (call_args, (*call_args)[nargs-1]);
>
> doesn't seem to work well because "obj" points to garbage after the vec_safe_reserve
> call:
>
> template<typename T, typename A>
> inline T *
> vec_safe_push (vec<T, A, vl_embed> *&v, const T &obj CXX_MEM_STAT_INFO)
> {
>   vec_safe_reserve (v, 1, false PASS_MEM_STAT);
>   return v->quick_push (obj);
> }

Ah, sneaky pass by reference.

> But using a dedicated variable works even when vec_safe_reserve actually
> extends.
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk/9?

OK, thanks.

Jason

      reply	other threads:[~2019-05-06 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-06 16:32 Marek Polacek
2019-05-06 16:46 ` Jason Merrill [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='CADzB+2kasoD0O5v2Qs5qE1w6qXKPNw_2hHNi=+Qc+_+E=z6THg@mail.gmail.com' \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=polacek@redhat.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).