Thread overview
[Issue 621] New: When inside a loop, if you call break inside a try block the finally block is never executed
Nov 30, 2006
d-bugmail
Nov 30, 2006
d-bugmail
Dec 30, 2006
d-bugmail
Jan 09, 2007
d-bugmail
Jan 28, 2007
d-bugmail
November 30, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=621

           Summary: When inside a loop, if you call break inside a try block
                    the finally block is never executed
           Product: D
           Version: 0.175
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: juanjo@comellas.com.ar


This bug happens only on Linux. I've verified that it works with DMD on Windows. Here's a sample program that shows the bug:


import std.stdio;

int main(char[][] args)
{
    while (true)
    {
        try
        {
            writefln("one");
            break;
        }
        finally
        {
            // ERROR: This block is not executed
            writefln("two");
        }
    }
    writefln("three");

    return 0;
}


-- 

November 30, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=621





------- Comment #1 from juanjo@comellas.com.ar  2006-11-30 14:20 -------
The program should show the following output:

one
two
three

But on Linux you get:

one
three


-- 

December 30, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=621





------- Comment #2 from thomas-dloop@kuehne.cn  2006-12-30 07:47 -------
Added to DStress as http://dstress.kuehne.cn/run/b/break_12_A.d http://dstress.kuehne.cn/run/b/break_12_B.d

see also:
http://dstress.kuehne.cn/run/goto_10.d
http://dstress.kuehne.cn/run/goto_11.d


-- 

January 09, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=621





------- Comment #3 from larsivar@igesund.net  2007-01-09 03:48 -------
Seems to fundamentally be the same issue as #815


-- 

January 28, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=621


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #4 from bugzilla@digitalmars.com  2007-01-27 18:53 -------
Fixed DMD 1.001


--