[Issue 7018] New: finally block not executed for assertions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 26 15:02:35 PST 2011


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

           Summary: finally block not executed for assertions
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dawg at dawgfoto.de


--- Comment #0 from dawg at dawgfoto.de 2011-11-26 15:01:32 PST ---
void main(string[] args)
{
    try
    {
        assert(args.length > 1);
    }
    finally
    {
        extern(C) void printf(const char* format, ...);
        printf("finally\n");
    }
}

---

The issue is that AssertExp is marked as nothrow.


This bug is responsible for the deadlocks in druntime unittests.

synchronized(foo)
{
  assert(exp);
}

is rewritten as

_d_monitorenter(__sync);
assert(exp);
_d_monitorexit(__sync);

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