commit a59844f: [Minor] Clang-plugin: Continue check if callee get failed

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Oct 21 11:35:06 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-10-21 12:18:55 +0100
URL: https://github.com/rspamd/rspamd/commit/a59844f720d2ae42a5832e56c80877d5edd664e0

[Minor] Clang-plugin: Continue check if callee get failed

---
 clang-plugin/printf_check.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/clang-plugin/printf_check.cc b/clang-plugin/printf_check.cc
index cecd845a2..35df5952d 100644
--- a/clang-plugin/printf_check.cc
+++ b/clang-plugin/printf_check.cc
@@ -384,13 +384,15 @@ namespace rspamd {
 		bool VisitCallExpr (CallExpr *E)
 		{
 			if (E->getCalleeDecl () == nullptr) {
-				llvm::errs () << "Bad callee\n";
-				return false;
+				print_remark ("cannot get callee decl",
+						E, this->pcontext, this->ci);
+				return true;
 			}
 			auto callee = dyn_cast<NamedDecl> (E->getCalleeDecl ());
 			if (callee == NULL) {
-				llvm::errs () << "Bad callee\n";
-				return false;
+				print_remark ("cannot get named callee decl",
+						E, this->pcontext, this->ci);
+				return true;
 			}
 
 			auto fname = callee->getNameAsString ();


More information about the Commits mailing list