www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7107] New: Compiled program aborts when using foreach and std.regex.splitter

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7107

           Summary: Compiled program aborts when using foreach and
                    std.regex.splitter
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: ttanjo gmail.com



Created an attachment (id=1052)
The output of the compiled program

When I compiled the following code with DMD v2.057 with -inline option,
the compiled program aborts in runtime (on Linux 64bit).

When I use regex("h") or regex(" ") instead of regex("  "),
this code works correctly.

issue.d:
----------------------------------------------------

import std.regex;
import std.stdio;

void main() {
  foreach(w; splitter("hoge fuga", regex("  "))) {
    writeln(w);
    writeln(w.length);
  }
}

----------------------------------------------------

I attached the output of the compiled program.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 14 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7107




This problem does not occurs in Windows 7 64bit.

Output is:
----
hoge fuga
9
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 14 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7107


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

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



10:52:44 PDT ---
Can't reproduce with 2.059 on Fedora x86_64.

I tried:
dmd x.d 
dmd -inline -O x.d
dmd -m64 -inline -O x.d
dmd -m64 -inline x.d

All work. It's either a problem with your specific setup or it was fixed
somewhere between 2.057-2.059.

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