From c8211ec6f681b9fe36a0aba4560b66afdfca8e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Martins?= Date: Sun, 13 Feb 2022 10:58:42 +0000 Subject: [PATCH] Fix check for misra addon in executeAddons. (#3819) In the CppCheck::executeAddons function, a check that specifically tests for the misra add-on, was not taking into account the cases when the addon is identified with the '.py' extension or indirectly via json. This resulted in the add-on not being executed a second time which is needed to detected some of the misra violations. By using the AddonInfo class name field, the addon name is uniformized for all these cases and the add-on executed a second time. Signed-off-by: Jose Martins --- lib/cppcheck.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 070892869..34b75d3bc 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -1366,7 +1366,7 @@ void CppCheck::executeAddons(const std::vector& files) mExitCode = 1; continue; } - if (addon != "misra" && !addonInfo.ctu && endsWith(files.back(), ".ctu-info")) + if (addonInfo.name != "misra" && !addonInfo.ctu && endsWith(files.back(), ".ctu-info")) continue; const std::string results =