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

--- Comment #0 from Val Markovic <> 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"\*
                    \*", "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:
------- You are receiving this mail because: -------

Reply via email to