[Issue 9669] New: Throw in a pre-condition of a nothrow function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 8 12:12:27 PST 2013


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

           Summary: Throw in a pre-condition of a nothrow function
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-03-08 12:12:26 PST ---
This code compiles with dmd 2.063alpha:


void foo() nothrow
in {
    throw new Exception(null);
} body {
}
void main() {
    foo();
}



Then it throws at runtime:

object.Exception at test.d(3)
---------
0x00402044 in nothrow void test.foo() at ...
...


I think that's bad because I think the "nothrow" tag used by the compiler to
better optimize functions.

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