<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/116925>116925</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            break out of __finally block fails assert (!BreakContinueStack.empty() && "break stmt not in a loop or switch!")
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jaykrell
      </td>
    </tr>
</table>

<pre>
    ```
int main()
{
    int a = 10;
 while (1)
    {
        __try {
            a = 20;
 *(volatile char*)0;
            a = 30;
        }
 __finally
        {
            // Next line is not needed.
 //a = _abnormal_termination() ? 40 : 50;
        
            //goto A;
        
            break;;
        }
    }

A:
 return a;
}

/*
1.c(18,13): warning: jump out of __finally block has undefined behavior [-Wjump-seh-finally]
            break;;
 ^
Assertion failed: !BreakContinueStack.empty() && "break stmt not in a loop or switch!", file C:\Users\swift-ci\jenkins\workspace\oss-swift-windows-toolchain\llvm-project\clang\lib\CodeGen\CGStmt.cpp, line 1390
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump
    0. Program arguments: ...
    1. <eof> parser at end of file
    2. Code generation
    3. Running pass 'Function Pass Manager' on module '1.c'.
    4. Running pass 'Module Verifier' on function '@"?fin$0@0@main@@"'
    clang-cl: error: clang frontend command failed with exit code 70 (use -v to see invocation)
*/
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VU2PozgQ_TXOpRQEBkI4cEjTnbnsrEY72t1jZEwR3DE2sk0y_e9XBfnonZ6RRist6g9TflUuv3pVCO_V0SBWLH9i-fNKTKG3rnoVbyeHWq8a275VbBNff-JnFu-UCTAIZRjfMl4uNlY8LQsAAAIIYOkzJDFLbxuXXmkExrfJ3YvA__Kk53AI7u2jmZ4lKH8XlPEd49uz1SJQdNkLN5vKd5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