[PATCH] D147791: [NFC][CLANG] Fix static analyzer tool remarks about unchecked return values
Soumi Manna via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 7 09:12:20 PDT 2023
Manna created this revision.
Manna added reviewers: erichkeane, aaron.ballman.
Herald added subscribers: manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, a.sidorin, baloghadamsoftware.
Herald added a reviewer: NoQ.
Herald added projects: All, clang, clang-format.
Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay.
Manna requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Reported by Coverity:
Unchecked return value
If the function returns an error value, the error value may be mistaken for a normal value.
1. Inside "Parser.cpp" file, in clang::Parser::ParseKNRParamDeclarations(clang::Declarator &): Value returned from a function is not checked for errors before being used.
check_return: Calling TryConsumeToken without checking return value (as is done elsewhere 75 out of 86 times).
2. Inside "CallGraph.h" file, in clang::CallGraph::addToCallGraph(clang::Decl *): Value returned from a function is not checked for errors before being used.
check_return: Calling TraverseDecl without checking return value (as is done elsewhere 22 out of 23 times).
3. Inside "TokenAnnotator.cpp" file ,in clang::format::<unnamed>::AnnotatingParser::consumeToken(): Value returned from a function is not checked for errors before being used.
check_return: Calling consumeToken without checking return value (as is done elsewhere 6 out of 7 times).
4. Inside "UnsafeBufferUsage.cpp" file, In clang::ast_matchers::MatchDescendantVisitor::findMatch(clang::DynTypedNode const &): Value returned from a function is not checked for errors before being used.
check_return: Calling TraverseStmt without checking return value (as is done elsewhere 485 out of 489 times)
5. Inside "ItaniumDemangle.h" file, in llvm::itanium_demangle::AbstractManglingParser<llvm::itanium_demangle::ManglingParser<<unnamed>::CanonicalizerAllocator>, <unnamed>::CanonicalizerAllocator>::parseFunctionType(): Value returned from a function is not checked for errors before being used.
check_return: Calling consumeIf without checking return value (as is done elsewhere 47 out of 50 times).
6. Inside "ItaniumDemangle.h" file, in llvm::itanium_demangle::AbstractManglingParser<llvm::itanium_demangle::ManglingParser<<unnamed>::CanonicalizerAllocator>, <unnamed>::CanonicalizerAllocator>::parseBaseUnresolvedName(): Value returned from a function is not checked for errors before being used.
check_return: Calling consumeIf without checking return value (as is done elsewhere 47 out of 50 times).
7. Inside "ItaniumDemangle.h" file, in llvm::itanium_demangle::AbstractManglingParser<llvm::itanium_demangle::ManglingParser<llvm::esimd::SimpleAllocator>, llvm::esimd::SimpleAllocator>::parseNumber(bool): Value returned from a function is not checked for errors before being used.
check_return: Calling consumeIf without checking return value (as is done elsewhere 95 out of 102 times).
8. Inside "ExprConstant.cpp" file, in clang::Expr::isPotentialConstantExprUnevaluated(clang::Expr *, clang::FunctionDecl const *, llvm::SmallVectorImpl<std::pair<clang::SourceLocation, clang::PartialDiagnostic>> &): Value returned from a function is not checked for errors before being used.
check_return: Calling Evaluate without checking return value (as is done elsewhere 23 out of 27 times).
9. Inside "ASTMatchFinder.cpp" file, in clang::ast_matchers::internal::<unnamed>::MatchASTVisitor::dataTraverseNode(clang::Stmt *, llvm::SmallVectorImpl<llvm::PointerIntPair<clang::Stmt *, 1u, bool, llvm::PointerLikeTypeTraits<clang::Stmt *>, llvm::PointerIntPairInfo<clang::Stmt *, 1u, llvm::PointerLikeTypeTraits<clang::Stmt *>>>> *): Value returned from a function is not checked for errors before being used.
check_return: Calling TraverseDecl without checking return value (as is done elsewhere 29 out of 33 times).
10. Inside "ParseObjc.cpp" file, in clang::Parser::isStartOfObjCClassMessageMissingOpenBracket(): Value returned from a function is not checked for errors before being used.
check_return: Calling TryAnnotateTypeOrScopeToken without checking return value (as is done elsewhere 19 out of 21 times).
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D147791
Files:
clang/include/clang/Analysis/CallGraph.h
clang/lib/AST/ExprConstant.cpp
clang/lib/ASTMatchers/ASTMatchFinder.cpp
clang/lib/Analysis/UnsafeBufferUsage.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/lib/Parse/ParseObjc.cpp
clang/lib/Parse/Parser.cpp
llvm/include/llvm/Demangle/ItaniumDemangle.h
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147791.511701.patch
Type: text/x-patch
Size: 4285 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230407/62db8bf8/attachment-0001.bin>
More information about the cfe-commits
mailing list