D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7300 - std.regex.ShiftOr!dchar.search is broken
Summary: std.regex.ShiftOr!dchar.search is broken
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-15 23:45 UTC by Nils
Modified: 2012-03-30 08:33 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nils 2012-01-15 23:45:02 UTC
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 github-bugzilla 2012-03-30 06:26:53 UTC
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