public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/105502] [9/12/11/12/13 Regression] std::normal_distribution deserialization issue
Date: Fri, 06 May 2022 14:35:06 +0000	[thread overview]
Message-ID: <bug-105502-4-1xo2Jxi2iO@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105502-4@http.gcc.gnu.org/bugzilla/>

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org
      Known to work|                            |8.3.0, 9.2.0
            Summary|std::normal_distribution    |[9/12/11/12/13 Regression]
                   |deserialization issue       |std::normal_distribution
                   |                            |deserialization issue
   Last reconfirmed|                            |2022-05-06
           Keywords|                            |wrong-code
      Known to fail|                            |10.1.0, 11.1.0, 12.1.0,
                   |                            |13.0, 8.4.0, 9.3.0
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Target Milestone|---                         |9.5

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Ouch, yes, thanks for the report.

This is the fix:

--- a/libstdc++-v3/include/bits/random.tcc
+++ b/libstdc++-v3/include/bits/random.tcc
@@ -1962,10 +1962,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       if (__is >> __mean >> __stddev >> __saved_avail)
        {
          if (__saved_avail && (__is >> __x._M_saved))
-           {
-             __x._M_saved_available = __saved_avail;
-             __x.param(param_type(__mean, __stddev));
-           }
+           __x._M_saved_available = __saved_avail;
+
+         if (__is)
+           __x.param(param_type(__mean, __stddev));
        }

       __is.flags(__flags);

  reply	other threads:[~2022-05-06 14:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-06  8:28 [Bug libstdc++/105502] New: " frank.marschner at cognitec dot com
2022-05-06 14:35 ` redi at gcc dot gnu.org [this message]
2022-05-06 20:51 ` [Bug libstdc++/105502] [9/10/11/12/13 Regression] " redi at gcc dot gnu.org
2022-05-06 22:55 ` cvs-commit at gcc dot gnu.org
2022-05-06 22:59 ` cvs-commit at gcc dot gnu.org
2022-05-06 22:59 ` [Bug libstdc++/105502] [9/10/11 " redi at gcc dot gnu.org
2022-05-09 15:09 ` cvs-commit at gcc dot gnu.org
2022-05-09 16:35 ` cvs-commit at gcc dot gnu.org
2022-05-09 16:44 ` cvs-commit at gcc dot gnu.org
2022-05-09 16:44 ` redi 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-105502-4-1xo2Jxi2iO@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).