mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-05-16 10:56:21 +00:00

The assertion only happens with use of -fasy-exception without -fexcessions. The assertion appen during the call to generate SehScopeBegin(), where assert with: assert(CGF.Builder.GetInsertBlock() && InvokeDest); InvokeDest is null. Because exceptions are disabled, and SEH is not in use. The fix is before call EmitSehCppScopeBegin check getInvokeDest(), to avoid assert during the emit llvm.seh.scope.begin() Differential Revision: https://reviews.llvm.org/D157566
23 lines
557 B
C++
23 lines
557 B
C++
// RUN: %clang_cc1 -triple x86_64-windows -fasync-exceptions -x c++ \
|
|
// RUN: -emit-llvm %s -o -| FileCheck %s
|
|
|
|
extern "C" int printf(const char*,...);
|
|
class PrintfArg
|
|
{
|
|
public:
|
|
PrintfArg();
|
|
PrintfArg(const char* s);
|
|
|
|
// compiler crash fixed if this destructor removed
|
|
~PrintfArg() {int x; printf("ddd\n"); }
|
|
};
|
|
|
|
void devif_Warning(const char* fmt, PrintfArg arg1 = PrintfArg());
|
|
// CHECK-NOT: invoke void @llvm.seh.scope.begin()
|
|
// CHECK-NOT: invoke void @llvm.seh.scope.end()
|
|
unsigned myfunc(unsigned index)
|
|
{
|
|
devif_Warning("");
|
|
return 0;
|
|
}
|