[Issue 8725] New: segmentation fault with negative-lookahead in module-level regex
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Sep 25 22:30:55 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8725
Summary: segmentation fault with negative-lookahead in
module-level regex
Product: D
Version: D2
Platform: x86_64
OS/Version: Mac OS X
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: val at markovic.io
--- Comment #0 from Val Markovic <val at markovic.io> 2012-09-25 22:31:39 PDT ---
The following program crashes with a segmentation fault:
-------------
#!/usr/bin/env rdmd
import std.stdio;
import std.regex;
auto italic = regex( r"\*
(?!\s+)
(.*?)
(?!\s+)
\*", "gx" );
void main() {
string input = "this * is* interesting, *very* interesting";
writeln( replace( input, italic, "<i>$1</i>" ) );
}
--------------
If one removes the first line with (?!\s+), then the program doesn't crash.
I was under the impression that this snippet of code operates under the SafeD
subset and therefore shouldn't cause a segmentation fault. A thrown exception
on problems or something, that I can understand. But a segfault?
In other sad news, these are the first lines of D I've ever written :( ... so
much for experimentation...
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list