Lines Matching refs:C
51 AllocKind &AKind, CheckerContext &C) const;
53 CheckerContext &C) const;
54 void reportPointerArithMisuse(const Expr *E, CheckerContext &C,
56 void initAllocIdentifiers(ASTContext &C) const;
63 void checkPreStmt(const UnaryOperator *UOp, CheckerContext &C) const;
64 void checkPreStmt(const BinaryOperator *BOp, CheckerContext &C) const;
65 void checkPreStmt(const ArraySubscriptExpr *SubExpr, CheckerContext &C) const;
66 void checkPreStmt(const CastExpr *CE, CheckerContext &C) const;
67 void checkPostStmt(const CastExpr *CE, CheckerContext &C) const;
68 void checkPostStmt(const CXXNewExpr *NE, CheckerContext &C) const;
69 void checkPostStmt(const CallExpr *CE, CheckerContext &C) const;
70 void checkDeadSymbols(SymbolReaper &SR, CheckerContext &C) const;
77 CheckerContext &C) const { in REGISTER_MAP_WITH_PROGRAMSTATE()
106 CheckerContext &C) const { in getPointedRegion()
108 ProgramStateRef State = C.getState(); in getPointedRegion()
120 CheckerContext &C) const { in getArrayRegion()
130 ProgramStateRef State = C.getState(); in getArrayRegion()
149 CheckerContext &C, in reportPointerArithMisuse() argument
155 ProgramStateRef State = C.getState(); in reportPointerArithMisuse()
156 const MemRegion *Region = C.getSVal(E).getAsRegion(); in reportPointerArithMisuse()
160 Region = getPointedRegion(Region, C); in reportPointerArithMisuse()
167 getArrayRegion(Region, IsPolymorphic, Kind, C)) { in reportPointerArithMisuse()
170 if (ExplodedNode *N = C.generateNonFatalErrorNode()) { in reportPointerArithMisuse()
180 C.emitReport(std::move(R)); in reportPointerArithMisuse()
193 if (ExplodedNode *N = C.generateNonFatalErrorNode()) { in reportPointerArithMisuse()
203 C.emitReport(std::move(R)); in reportPointerArithMisuse()
207 void PointerArithChecker::initAllocIdentifiers(ASTContext &C) const { in initAllocIdentifiers()
210 AllocFunctions.insert(&C.Idents.get("alloca")); in initAllocIdentifiers()
211 AllocFunctions.insert(&C.Idents.get("malloc")); in initAllocIdentifiers()
212 AllocFunctions.insert(&C.Idents.get("realloc")); in initAllocIdentifiers()
213 AllocFunctions.insert(&C.Idents.get("calloc")); in initAllocIdentifiers()
214 AllocFunctions.insert(&C.Idents.get("valloc")); in initAllocIdentifiers()
218 CheckerContext &C) const { in checkPostStmt()
219 ProgramStateRef State = C.getState(); in checkPostStmt()
220 const FunctionDecl *FD = C.getCalleeDecl(CE); in checkPostStmt()
224 initAllocIdentifiers(C.getASTContext()); in checkPostStmt()
228 SVal SV = C.getSVal(CE); in checkPostStmt()
237 C.addTransition(State); in checkPostStmt()
241 CheckerContext &C) const { in checkPostStmt()
248 ProgramStateRef State = C.getState(); in checkPostStmt()
249 SVal AllocedVal = C.getSVal(NE); in checkPostStmt()
254 C.addTransition(State); in checkPostStmt()
258 CheckerContext &C) const { in checkPostStmt()
263 ProgramStateRef State = C.getState(); in checkPostStmt()
264 SVal CastedVal = C.getSVal(CastedExpr); in checkPostStmt()
272 C.addTransition(State); in checkPostStmt()
276 CheckerContext &C) const { in checkPreStmt()
281 ProgramStateRef State = C.getState(); in checkPreStmt()
282 SVal CastedVal = C.getSVal(CastedExpr); in checkPreStmt()
293 C.addTransition(State); in checkPreStmt()
297 CheckerContext &C) const { in checkPreStmt()
300 reportPointerArithMisuse(UOp->getSubExpr(), C, true); in checkPreStmt()
304 CheckerContext &C) const { in checkPreStmt()
305 SVal Idx = C.getSVal(SubsExpr->getIdx()); in checkPreStmt()
314 reportPointerArithMisuse(SubsExpr->getBase(), C); in checkPreStmt()
318 CheckerContext &C) const { in checkPreStmt()
325 ProgramStateRef State = C.getState(); in checkPreStmt()
328 SVal RHSVal = C.getSVal(Rhs); in checkPreStmt()
331 reportPointerArithMisuse(Lhs, C, !BOp->isAdditiveOp()); in checkPreStmt()
335 SVal LHSVal = C.getSVal(Lhs); in checkPreStmt()
338 reportPointerArithMisuse(Rhs, C); in checkPreStmt()