File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
clang/lib/StaticAnalyzer/Checkers/CHERI Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 2121#include " clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h"
2222#include " clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h"
2323#include " clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
24+ #include < clang/StaticAnalyzer/Core/PathSensitive/CallDescription.h>
2425
2526using namespace clang ;
2627using namespace ento ;
@@ -42,6 +43,10 @@ class AllocationChecker
4243 BugType BT_KnownReg{this , " Heap or static allocation partitioning" ,
4344 " CHERI portability" };
4445
46+ const CallDescriptionSet IgnoreFnSet = {
47+ {{CDM::SimpleFunc, {" free" }, 1 }},
48+ };
49+
4550 class AllocPartitionBugVisitor : public BugReporterVisitor {
4651 public:
4752 AllocPartitionBugVisitor (const MemRegion *P, const MemRegion *A)
@@ -253,6 +258,9 @@ void AllocationChecker::checkPostStmt(const CastExpr *CE,
253258
254259void AllocationChecker::checkPreCall (const CallEvent &Call,
255260 CheckerContext &C) const {
261+ if (IgnoreFnSet.contains (Call))
262+ return ;
263+
256264 ProgramStateRef State = C.getState ();
257265 ExplodedNode *N = nullptr ;
258266 bool Updated = false ;
You can’t perform that action at this time.
0 commit comments