This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[Patch 2/3] Make regex's infinite loop detection accurate
- From: Tim Shen <timshen91 at gmail dot com>
- To: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 25 Apr 2014 16:40:42 -0400
- Subject: [Patch 2/3] Make regex's infinite loop detection accurate
- Authentication-results: sourceware.org; auth=none
regex_match("", regex("(?:)*") will cause segfault because the
infinite loop detection (writeen by me) is stupid. :O
Instead of checking begins and ends, now the executor tracks repeating
count for every loop node (typically generated from the Kleene star
*).
It slows down the executor a bit (from 1.8s to 2.0s in my machine),
but it's about the correctness.
The whole patch series are booted and tested, but this one is not
separately tested.
Thanks!
--
Regards,
Tim Shen