public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Jean-Baptiste Daval <naarakah@crans.org>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR libstdc++/70664 Set failbit and read zero on stream reading negative value into unsigned type
Date: Tue, 13 Mar 2018 16:46:00 -0000	[thread overview]
Message-ID: <CAH6eHdTmsfk4-AfeQgZHppga7qd2GASm16MZ7BkgWA1tDixNig@mail.gmail.com> (raw)
In-Reply-To: <ea451cae-782b-69ee-cff4-26b761f451fd@crans.org>

On 13 March 2018 at 15:55, Jean-Baptiste Daval wrote:
> Hi,
>
> Currently when a value is extracted from a stream into a unsigned type,
> there is no test to check if the value is negative, in which case there
> is an overflow and failbit is not set (the correct behavior would be to
> read a zero and set failbit). This patch add a condition to check when
> we are in this particular case, read a zero and set failbit accordingly.

Thank you for the patch. It looks small enough that we don't need a
copyright assignment. The GCC trunk is currently only open for
regression fixes (and we also allow changes to C++17 library features
while our C++17 support is considered experimental). As soon as the
trunk re-opens for normal changes I'll apply your patch. For now I've
updated the bug report with a link to your patch, so we won't forget
about it.

      reply	other threads:[~2018-03-13 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-13 15:55 Jean-Baptiste Daval
2018-03-13 16:46 ` Jonathan Wakely [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=CAH6eHdTmsfk4-AfeQgZHppga7qd2GASm16MZ7BkgWA1tDixNig@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=naarakah@crans.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).