Bug 7300 – std.regex.ShiftOr!dchar.search is broken
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2012-01-15T23:45:00Z
Last change time
2012-03-30T08:33:39Z
Assigned to
nobody
Creator
nilsbossung
Comments
Comment #0 by nilsbossung — 2012-01-15T23:45:02Z
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
---
Comment #1 by github-bugzilla — 2012-03-30T06:26:53Z