www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11562] New: Goto into or out of finally block is not caught during semantic

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11562

           Summary: Goto into or out of finally block is not caught during
                    semantic
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid, pull, wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: yebblies gmail.com
        ReportedBy: yebblies gmail.com
            Blocks: 602


--- Comment #0 from yebblies <yebblies gmail.com> 2013-11-20 21:17:35 EST ---
These should all pass:

// Goto into finally block (forwards)
static assert(!__traits(compiles, (bool b)
{
    if (b) goto label;
    try
    {
    }
    finally
    {
    label: {}
    }
    return 1;
}));

// // Goto into finally block (backwards)
static assert(!__traits(compiles, (bool b)
{
    try
    {
    }
    finally
    {
    label: {}
    }
    if (b) goto label;
    return 1;
}));

// Goto out of finally block (forwards)
static assert(!__traits(compiles, (bool b)
{
    try
    {
    }
    finally
    {
    if (b) goto label;
    }
    label: {}
    return 1;
}));

// // Goto out of finally block (backwards)
static assert(!__traits(compiles, (bool b)
{
    label: {}
    try
    {
    }
    finally
    {
    if (b) goto label;
    }
    return 1;
}));

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11562



--- Comment #1 from yebblies <yebblies gmail.com> 2013-11-20 21:24:46 EST ---
https://github.com/D-Programming-Language/dmd/pull/2836

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11562



--- Comment #2 from github-bugzilla puremagic.com 2013-11-20 15:43:56 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/50897fb9a77a4911f22123bb2e9240e12cdfaf17
Fix Issue 11562 - Goto into or out of finally block is not caught during
semantic

https://github.com/D-Programming-Language/dmd/commit/ba945fa6d6bc538c25d7751cbfa1c7d417f1a031
Merge pull request #2836 from yebblies/issue11562

Issue 11562 - Goto into or out of finally block is not caught during semantic

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11562


yebblies <yebblies gmail.com> changed:

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


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2013