Thread overview
[Issue 7300] New: std.regex.ShiftOr!dchar.search is broken
Jan 16, 2012
Nils
Mar 30, 2012
Dmitry Olshansky
January 16, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7300

           Summary: std.regex.ShiftOr!dchar.search is broken
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: mailme+d@nilsb.dyndns.org


--- Comment #0 from Nils <mailme+d@nilsb.dyndns.org> 2012-01-15 23:45:02 PST ---
I stumbled over this:
---
import std.regex;
void main() {
std.regex.match("a"d, "aa"d);
}
---
=> core.exception.AssertError@/home/nils/d/dmd2/linux/bin32/../../src/phobos/std/utf.d(800): Attempted to decode past the end of a string

I traced it down to ShiftOr.search returning a value greater than the input length:
---
dstring
    input = "a",
    pattern = "aa";
assert(regex(pattern).kickstart.search(input, 0) <= input.length); // fails
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 30, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7300



--- Comment #1 from github-bugzilla@puremagic.com 2012-03-30 06:26:53 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/84a847cbe18f6b42597436ce01a0d1b1ce932ff7 Merge pull request #462 from blackwhale/regex-fixes

fix Issue 7300 - std.regex.ShiftOr!dchar.search is broken

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 30, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7300


Dmitry Olshansky <dmitry.olsh@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dmitry.olsh@gmail.com
         Resolution|                            |FIXED


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