Skip to content

continue in __finally fails assert (!BreakContinueStack.empty() && "continue stmt not in a loop) #116926

@jaykrell

Description

@jaykrell
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;
        
            continue;
        }
    }

A:
    return a;
}

/*
1.c(18,13): warning: jump out of __finally block has undefined behavior [-Wjump-seh-finally]
break;;
^
Assertion failed: !BreakContinueStack.empty() && "continue stmt not in a loop!", file C:\Users\swift-ci\jenkins\workspace\oss-swift-windows-toolchain\llvm-project\clang\lib\CodeGen\CGStmt.cpp, line 1402
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:

  1. parser at end of file
  2. 1.c:1:5: LLVM IR generation of declaration 'main'
  3. 1.c:1:5: Generating code for declaration 'main'
  4. 1.c:5:5: LLVM IR generation of compound statement ('{}')
  5. 1.c:12:9: LLVM IR generation of compound statement ('{}')
    */

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:codegenIR generation bugs: mangling, exceptions, etc.crashPrefer [crash-on-valid] or [crash-on-invalid]extension:microsoft

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions