Skip to content

Commit e9c5f41

Browse files
committed
[cxx-interop] Add stack trace entry for the safety heuristic
To better investigate reports of an infinite recursion in `hasPointerInSubobjects`, let's add a pretty stack trace entry to get more readable crash reports. rdar://131366982
1 parent 71c27a9 commit e9c5f41

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7366,6 +7366,10 @@ static bool hasNonCopyableAttr(const clang::RecordDecl *decl) {
73667366
/// Recursively checks that there are no pointers in any fields or base classes.
73677367
/// Does not check C++ records with specific API annotations.
73687368
static bool hasPointerInSubobjects(const clang::CXXRecordDecl *decl) {
7369+
clang::PrettyStackTraceDecl trace(decl, clang::SourceLocation(),
7370+
decl->getASTContext().getSourceManager(),
7371+
"looking for pointers in subobjects of");
7372+
73697373
// Probably a class template that has not yet been specialized:
73707374
if (!decl->getDefinition())
73717375
return false;

0 commit comments

Comments
 (0)