File tree Expand file tree Collapse file tree 6 files changed +107
-102
lines changed Expand file tree Collapse file tree 6 files changed +107
-102
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) {
102102 // stack of thrown exception.
103103 const utils::ExceptionAnalyzer::CallStack &Stack = ThrowInfo.Stack ;
104104 diag (Stack.front ()->getLocation (),
105- " example of unhandled exception throw stack , starting from function %0" ,
105+ " throw stack of unhandled exception, starting from function %0" ,
106106 DiagnosticIDs::Note)
107107 << Stack.front ();
108108
Original file line number Diff line number Diff line change @@ -491,9 +491,13 @@ ExceptionAnalyzer::throwsException(const FunctionDecl *Func,
491491
492492 auto Result = ExceptionInfo::createUnknown ();
493493 if (const auto *FPT = Func->getType ()->getAs <FunctionProtoType>()) {
494- for (const QualType &Ex : FPT->exceptions ())
495- // Nothing in ThrowInfo because there is no location of 'throw'
496- Result.registerException (Ex.getTypePtr (), {});
494+ for (const QualType &Ex : FPT->exceptions ()) {
495+ CallStack.insert (Func);
496+ Result.registerException (
497+ Ex.getTypePtr (),
498+ {Func->getExceptionSpecSourceRange ().getBegin (), CallStack});
499+ CallStack.remove (Func);
500+ }
497501 }
498502 return Result;
499503}
You can’t perform that action at this time.
0 commit comments