[llvm-bugs] [Bug 42266] New: [WinEH64] AP crushes when throw and catch in a particular nest form

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 12 19:53:56 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42266

            Bug ID: 42266
           Summary: [WinEH64]  AP crushes when throw and catch in a
                    particular nest form
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pengfei.wang at intel.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

The application works well when built by Clang 32bits and MSVC both 32 and
64bits, but it crushes when built by Clang 64bits.
Code:

#include <stdio.h>

void foo()
{
    try {
        throw 1;
    }
    catch (int x) {
        printf("Catch %d\n", x);
        try {
            try {
                throw 2;
            }
            catch (int x) {
                printf("Catch %d\n", x);
                throw 3;
            }
        }
        catch (int x) {
            printf("Catch %d\n", x);
        }
    }
};

int main()
{
    foo();
    printf("Successfully exit\n");
}

==============
clang -m64 -fcxx-exceptions test.cpp

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190613/217639d3/attachment.html>


More information about the llvm-bugs mailing list