This is an archive of the discontinued LLVM Phabricator instance.

Fix static analyzer tool remarks about unchecked return values
AbandonedPublic

Authored by Manna on Apr 6 2023, 7:15 PM.

Details

Summary

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).

  1. 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).

  1. Inside "SemaExpr.cpp" file, in clang::​Sema::​BuildCXXDefaultArgExpr(clang::​SourceLocation, clang::​FunctionDecl *, clang::​ParmVarDecl *, clang::​Expr *): 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 31 times)

  1. Inside "CGStmt.cpp" file, in clang::​CodeGen::​CodeGenFunction::​EmitAsmInput(clang::​TargetInfo::​ConstraintInfo const &, clang::​Expr const *, std::​__cxx11::​basic_string<char, std::​char_traits<char>, std::​allocator<char>> &): Value returned from a function is not checked for errors before being used.

check_return: Calling EvaluateAsRValue without checking return value (as is done elsewhere 21 out of 25 times).

  1. Inside "SemaChecking.cpp" file, in clang::​Sema::​CheckRISCVBuiltinFunctionCall(clang::​TargetInfo const &, unsigned int, clang::​CallExpr *): Value returned from a function is not checked for errors before being used.

check_return: Calling consume_front without checking return value (as is done elsewhere 180 out of 213 times)

Diff Detail

Event Timeline

Manna created this revision.Apr 6 2023, 7:15 PM
Herald added a project: Restricted Project. · View Herald Transcript
Manna requested review of this revision.Apr 6 2023, 7:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 6 2023, 7:15 PM
Manna abandoned this revision.EditedApr 6 2023, 8:03 PM

Abandoning this revision.