[Issue 11775] New: std.regex should check for valid repetition range in assert mode

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 19 08:27:54 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11775

           Summary: std.regex should check for valid repetition range in
                    assert mode
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-12-19 08:27:52 PST ---
-----
import std.regex;

void main()
{
    auto m = "12".match(r"\d{1,0}");  // invalid range
}
-----

$ dmd -run test.d
> core.exception.RangeError at std.regex(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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list