public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [libstdc++][PATCH] missing return statement in basic_regex::assign(basic_regex&&)
@ 2015-02-13 14:14 Paweł Tomulik
  2015-02-13 14:21 ` Paolo Carlini
  0 siblings, 1 reply; 2+ messages in thread
From: Paweł Tomulik @ 2015-02-13 14:14 UTC (permalink / raw)
  To: gcc-patches

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

Hi,

the header file  <bits/regex.h> of libstdc++-v3 of gcc-4.9 is missing
return statement in the implementation of
basic_regex::assign(basic_regex&&). This is about line 619. The minimal
example to reproduce this bug is the following:

#include <regex>
int main()
{
  std::regex re;
  re.assign(std::regex("blabla"));
  return EXIT_SUCCESS;
}

When compiled with clang and run it produces SIGILL:

ptomulik@tea:$ clang++ -std=c++11 -g -O0 -o test test.cpp
ptomulik@tea:$ ./test

I attach patch created with git against the "gcc-4_9_2-release" tag.

Best regards.

-- 
Paweł Tomulik, tel. (22) 234 7925
Instytut Techniki Lotniczej i Mechaniki Stosowanej
Politechnika Warszawska




[-- Attachment #2: regex.diff --]
[-- Type: text/x-patch, Size: 401 bytes --]

diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index fe10ceb..af5a414 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -623,6 +623,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	_M_original_str = std::move(__rhs._M_original_str);
 	__rhs._M_automaton.reset();
 	this->imbue(__rhs.getloc());
+	return *this;
       }
 
       /**



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [libstdc++][PATCH] missing return statement in basic_regex::assign(basic_regex&&)
  2015-02-13 14:14 [libstdc++][PATCH] missing return statement in basic_regex::assign(basic_regex&&) Paweł Tomulik
@ 2015-02-13 14:21 ` Paolo Carlini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Carlini @ 2015-02-13 14:21 UTC (permalink / raw)
  To: Paweł Tomulik, gcc-patches

Hi,

On 02/13/2015 03:14 PM, Paweł Tomulik wrote:
> Hi,
>
> the header file  <bits/regex.h> of libstdc++-v3 of gcc-4.9 is missing
> return statement in the implementation of
> basic_regex::assign(basic_regex&&). This is about line 619.
In current 4_9-branch, thus for 4.9.3, this is already fixed.

Thanks,
Paolo.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-13 14:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-13 14:14 [libstdc++][PATCH] missing return statement in basic_regex::assign(basic_regex&&) Paweł Tomulik
2015-02-13 14:21 ` Paolo Carlini

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).