www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 621] New: When inside a loop, if you call break inside a try block the finally block is never executed

reply d-bugmail puremagic.com writes:
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;
}


-- 
Nov 30 2006
next sibling parent d-bugmail puremagic.com writes:
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


-- 
Nov 30 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
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


-- 
Dec 30 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
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


-- 
Jan 09 2007
prev sibling parent d-bugmail puremagic.com writes:
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


-- 
Jan 27 2007