Issue 240144
Summary [clang][CodeGen][ObjC++] ARC message send on an MS-ABI target with a by-value C++ argument whose destructor may throw asserts `CGF.Builder.GetInsertBlock() == NullBB` in `NullReturnState::complete`
Labels crash, objective-c++, generated by fuzzer
Assignees
Reporter YuanchengJiang
    The following code:
```objc
struct S1 {
 ~S1() noexcept(false);
};
@interface C
- (void)set:(S1)s;
@end
void test(C *c) { [c set:S1()]; }
```

Resulted in this output:
```
clang++: /root/llvm-project/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp:1911: clang::CodeGen::RValue {anonymous}::NullReturnState::complete(clang::CodeGen::CodeGenFunction&, clang::CodeGen::ReturnValueSlot, clang::CodeGen::RValue, clang::QualType, const clang::CodeGen::CallArgList&, const clang::ObjCMethodDecl*): Assertion `CGF.Builder.GetInsertBlock() == NullBB' failed.
```

Trunk reproducer (`-x objective-c++ --target=x86_64-pc-windows-msvc -fobjc-runtime=macosx-10.14 -fobjc-arc`): https://godbolt.org/z/fbrMP7xhr

Strange flag: `--target=x86_64-pc-windows-msvc -fobjc-runtime=macosx-10.14`. Should be low priority.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to