www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10391] New: Segfault compiling on Mac OS 10.8

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

           Summary: Segfault compiling on Mac OS 10.8
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Mac OS X
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: spam kalekold.net


--- Comment #0 from Gary Willoughby <spam kalekold.net> 2013-06-17 08:17:39 PDT
---
Compile the following on Mac OS 10.8 with:

rdmd --force file.d 

To get a segfault: sh: line 1:  4242 Segmentation fault: 11  'dmd' '-v' '-o-'
'crash.d' '-I.' >
'/tmp/.rdmd-501/rdmd-crash.d-E195FFA0DB3CA615BD70C4621C863671/rdmd.deps'
Failed: 'dmd' '-v' '-o-' 'crash.d' '-I.'    


import std.datetime;
import std.string;
import std.stdio;

class Test
{
    public static string getMonth()
    {
        string[] months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
"Aug", "Sep", "Oct", "Nov", "Dec"];

        auto time = Clock.currTime();
        return format("%s", this.months[time.month - 1]); // using the 'this'
keyword produces segfault.
    }
}

void main(string[] arg)
{
    writefln("%s", Test.getMonth());
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 17 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10391


safety0ff.bugz <safety0ff.bugz gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |safety0ff.bugz gmail.com


--- Comment #1 from safety0ff.bugz <safety0ff.bugz gmail.com> 2013-10-26
21:49:10 PDT ---
This segfaults for 2.063.2 but runs fine on recent git version of dmd:
crash.d(12): Error: no property 'months' for type 'crash.Test'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 26 2013