public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Kefu Chai <tchaikov@gmail.com>
Cc: libstdc++@gcc.gnu.org
Subject: Re: [PATCH v1 0/1] Set _M_string_length before calling _M_dispose()
Date: Mon, 1 May 2023 21:05:17 +0100	[thread overview]
Message-ID: <CACb0b4nc3LNjDqf_gA4eRM3OQ8xNinL-W=kzWzgA4Np0tGvLNw@mail.gmail.com> (raw)
In-Reply-To: <CACb0b4mRnL0B0J7HDAE=4bQSUTX3=Egsih3qJQxLjyaOq-dz0A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1337 bytes --]

On Mon, 1 May 2023 at 21:04, Jonathan Wakely <jwakely@redhat.com> wrote:

>
>
> On Mon, 1 May 2023 at 08:06, Kefu Chai via Libstdc++ <
> libstdc++@gcc.gnu.org> wrote:
>
>> This patch fixes the false alarm when performing the check introduced by
>> bf78b43873b0b7e8f9a430df38749b8b61f9c9b8 . A minimal reproducer can be
>> found at https://godbolt.org/z/7q4nG68xn
>>
>> I am pasting the reproducer here just in case:
>>
>> #include <cstring>
>> #include <string>
>> #include <sstream>
>>
>> int main() {
>>     unsigned char buf[sizeof(std::string)] ;
>>     std::memset(buf, 0xff, sizeof(buf));
>>     const char s[] = "1234567890abcdefg";
>>     std::istringstream in{s};
>>     std::istreambuf_iterator<char> it{in}, end;
>>     auto* p = new (buf) std::string(it, end);
>>     return 0;
>> }
>>
>> Tested on x86_64-pc-linux-gnu, with "make check-target-libstdc++-v3".
>> Would be great if this change can be included in thunk, 13.2 and 12
>> branches.
>>
>
> The bf78b43873b0b7e8f9a430df38749b8b61f9c9b8 change isn't on the gcc-12
> branch.
>

Oh wait, yes it is - I was thinking of another change that I didn't
backport, sorry.


>
>
>> Kefu Chai (1):
>>   libstdc++: Set _M_string_length before calling _M_dispose()
>>
>>  libstdc++-v3/include/bits/basic_string.tcc | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> --
>> 2.40.1
>>
>>

      reply	other threads:[~2023-05-01 20:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-01  7:06 Kefu Chai
2023-05-01  7:06 ` [PATCH v1 1/1] libstdc++: " Kefu Chai
2023-05-02 14:06   ` Jonathan Wakely
2023-05-03  2:17   ` [PATCH v2 0/1] " Kefu Chai
2023-05-03  2:17     ` [PATCH v2 1/1] libstdc++: Set _M_string_length before calling _M_dispose() [PR109703] Kefu Chai
2023-05-03 12:22     ` [PATCH v2 0/1] Set _M_string_length before calling _M_dispose() Jonathan Wakely
2023-05-03 12:30       ` kefu chai
2023-05-01 20:04 ` [PATCH v1 " Jonathan Wakely
2023-05-01 20:05   ` 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='CACb0b4nc3LNjDqf_gA4eRM3OQ8xNinL-W=kzWzgA4Np0tGvLNw@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    --cc=tchaikov@gmail.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).