[Issue 5911] New: Closure destroys the thrown Exception .

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 29 23:00:04 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5911

           Summary: Closure destroys the thrown Exception .
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: sweatygarlic at yahoo.co.jp


--- Comment #0 from sweatygarlic at yahoo.co.jp 2011-04-29 22:56:17 PDT ---
The below ends with SEGV.
----------------------------
import std.stdio;

void logout( lazy const(char)[] msg ) { writeln( msg ); }
void main()
{
    string str = "hello world";
    logout( (){return str;}() );             // closure 1

    try throw new Exception( "exception!!" );
    catch( Exception e )
    {
        logout( e.toString );            // closure2 SEGV : e is null.
    }
}

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

Build : dmd 2.052 on Windows Vista WOW64.

Without `closure 1', the code executed successfully.

-- 
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