Bug 11775 – std.regex should check for valid repetition range in assert mode
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-12-19T08:27:00Z
Last change time
2013-12-20T00:48:53Z
Keywords
pull
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2013-12-19T08:27:52Z
-----
import std.regex;
void main()
{
auto m = "12".match(r"\d{1,0}"); // invalid range
}
-----
$ dmd -run test.d
> [email protected](5019): Range violation
Note that the exception is internal while trying to access an invalid index in an array. With -noboundscheck there will be no exceptions thrown.
I think at least in assert mode ( version(assert) ) the repetition range should be verified to be valid.