diff options
Diffstat (limited to 'clang/lib/AST/ByteCode/InterpFrame.cpp')
-rw-r--r-- | clang/lib/AST/ByteCode/InterpFrame.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/clang/lib/AST/ByteCode/InterpFrame.cpp b/clang/lib/AST/ByteCode/InterpFrame.cpp index d62a4f6..9342192 100644 --- a/clang/lib/AST/ByteCode/InterpFrame.cpp +++ b/clang/lib/AST/ByteCode/InterpFrame.cpp @@ -133,6 +133,11 @@ static bool shouldSkipInBacktrace(const Function *F) { MD && MD->getParent()->isAnonymousStructOrUnion()) return true; + if (const auto *Ctor = dyn_cast<CXXConstructorDecl>(FD); + Ctor && Ctor->isDefaulted() && Ctor->isTrivial() && + Ctor->isCopyOrMoveConstructor() && Ctor->inits().empty()) + return true; + return false; } @@ -202,7 +207,17 @@ SourceRange InterpFrame::getCallRange() const { return NullRange; return S.EvalLocation; } - return S.getRange(Caller->Func, RetPC - sizeof(uintptr_t)); + + // Move up to the frame that has a valid location for the caller. + for (const InterpFrame *C = this; C; C = C->Caller) { + if (!C->RetPC) + continue; + SourceRange CallRange = + S.getRange(C->Caller->Func, C->RetPC - sizeof(uintptr_t)); + if (CallRange.isValid()) + return CallRange; + } + return S.EvalLocation; } const FunctionDecl *InterpFrame::getCallee() const { |