Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1988 (new defect)

Opened 14 years ago

runtime ignores exceptions on termination

Reported by: winterwar Assigned to: community
Priority: major Milestone: 1.0
Component: Tango Version: 0.99.9 Kai
Keywords: Cc:

Description

This program outputs nothing and returns success when compiled in debug mode:

class X {
    ~this() {
        assert(false);
    }
}

void main() {
    auto x = new X();
}

The problem is that rt_term() in tango/core/rt/compiler/dmd/rt/dmain2.d just catches and eats any exceptions thrown by the rest of the termination code (in particular gc_term).