This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/63990] New: regex_search increments a past-the-end iterator


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

            Bug ID: 63990
           Summary: regex_search increments a past-the-end iterator
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kariya_mitsuru at hotmail dot com

Created attachment 34049
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34049&action=edit
g++ -v

The sample code below is aborted with "attempt to increment a past-the-end
iterator".

=========================================================================
#include <regex>
#include <debug/string>

int main()
{
    __gnu_debug::string s = "a";
    std::regex_search(s.begin(), s.end(), std::regex("b"));
}
=========================================================================
cf. http://melpon.org/wandbox/permlink/2EesivDageAWjAnN


It seems that it always occurs if regex_search is not matched.
It also seems that such an iterator is never accessed.

cf. http://melpon.org/wandbox/permlink/PfGxfu5qjoqaDgEm


I think that it may not cause any problem.
But it is better to fix.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]