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

            Bug ID: 68688
           Summary: segmentation fault on regex matching long strings
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kerukuro at gmail dot com
  Target Milestone: ---

This program crashes when compiled by gcc 5.2.1 or 5.1.1.
Works fine and matches the complete string when compiled by MSVC++2015.

#include <regex>
#include <string>

using namespace std;

int main()
{
        regex eq(R"(\w+)");
        string line(25500, 'a');
        smatch sm;
        regex_match(line, sm, eq);

        return 0;
}

Reply via email to