Lines Matching refs:CE
213 void checkPostStmt(const CallExpr *CE, CheckerContext &C) const;
306 const CallExpr *CE,
309 static ProgramStateRef MallocMemAux(CheckerContext &C, const CallExpr *CE,
313 static ProgramStateRef MallocMemAux(CheckerContext &C, const CallExpr *CE,
324 performKernelMalloc(const CallExpr *CE, CheckerContext &C,
335 ProgramStateRef FreeMemAttr(CheckerContext &C, const CallExpr *CE,
338 ProgramStateRef FreeMemAux(CheckerContext &C, const CallExpr *CE,
350 ProgramStateRef ReallocMemAux(CheckerContext &C, const CallExpr *CE,
356 static ProgramStateRef CallocMem(CheckerContext &C, const CallExpr *CE,
735 const CallExpr *CE, CheckerContext &C, const ProgramStateRef &State) const { in performKernelMalloc() argument
777 if (CE->getNumArgs() < 2) in performKernelMalloc()
780 const Expr *FlagsEx = CE->getArg(CE->getNumArgs() - 1); in performKernelMalloc()
806 return MallocMemAux(C, CE, CE->getArg(0), ZeroVal, TrueState); in performKernelMalloc()
823 void MallocChecker::checkPostStmt(const CallExpr *CE, CheckerContext &C) const { in checkPostStmt() argument
827 const FunctionDecl *FD = C.getCalleeDecl(CE); in checkPostStmt()
839 if (CE->getNumArgs() < 1) in checkPostStmt()
841 if (CE->getNumArgs() < 3) { in checkPostStmt()
842 State = MallocMemAux(C, CE, CE->getArg(0), UndefinedVal(), State); in checkPostStmt()
843 if (CE->getNumArgs() == 1) in checkPostStmt()
844 State = ProcessZeroAllocation(C, CE, 0, State); in checkPostStmt()
845 } else if (CE->getNumArgs() == 3) { in checkPostStmt()
847 performKernelMalloc(CE, C, State); in checkPostStmt()
851 State = MallocMemAux(C, CE, CE->getArg(0), UndefinedVal(), State); in checkPostStmt()
854 if (CE->getNumArgs() < 1) in checkPostStmt()
857 performKernelMalloc(CE, C, State); in checkPostStmt()
861 State = MallocMemAux(C, CE, CE->getArg(0), UndefinedVal(), State); in checkPostStmt()
863 if (CE->getNumArgs() < 1) in checkPostStmt()
865 State = MallocMemAux(C, CE, CE->getArg(0), UndefinedVal(), State); in checkPostStmt()
866 State = ProcessZeroAllocation(C, CE, 0, State); in checkPostStmt()
869 State = ReallocMemAux(C, CE, false, State); in checkPostStmt()
870 State = ProcessZeroAllocation(C, CE, 1, State); in checkPostStmt()
872 State = ReallocMemAux(C, CE, true, State); in checkPostStmt()
873 State = ProcessZeroAllocation(C, CE, 1, State); in checkPostStmt()
875 State = CallocMem(C, CE, State); in checkPostStmt()
876 State = ProcessZeroAllocation(C, CE, 0, State); in checkPostStmt()
877 State = ProcessZeroAllocation(C, CE, 1, State); in checkPostStmt()
879 State = FreeMemAux(C, CE, State, 0, false, ReleasedAllocatedMemory); in checkPostStmt()
882 State = MallocUpdateRefState(C, CE, State); in checkPostStmt()
884 State = MallocUpdateRefState(C, CE, State); in checkPostStmt()
886 if (CE->getNumArgs() < 1) in checkPostStmt()
888 State = MallocMemAux(C, CE, CE->getArg(0), UndefinedVal(), State, in checkPostStmt()
890 State = ProcessZeroAllocation(C, CE, 0, State); in checkPostStmt()
898 State = MallocMemAux(C, CE, CE->getArg(0), UndefinedVal(), State, in checkPostStmt()
900 State = ProcessZeroAllocation(C, CE, 0, State); in checkPostStmt()
903 State = MallocMemAux(C, CE, CE->getArg(0), UndefinedVal(), State, in checkPostStmt()
905 State = ProcessZeroAllocation(C, CE, 0, State); in checkPostStmt()
908 State = FreeMemAux(C, CE, State, 0, false, ReleasedAllocatedMemory); in checkPostStmt()
914 State = MallocMemAux(C, CE, UnknownVal(), UnknownVal(), State, in checkPostStmt()
917 State = FreeMemAux(C, CE, State, 0, false, ReleasedAllocatedMemory); in checkPostStmt()
919 if (CE->getNumArgs() < 1) in checkPostStmt()
923 State = MallocMemAux(C, CE, CE->getArg(0), zeroVal, State); in checkPostStmt()
924 State = ProcessZeroAllocation(C, CE, 0, State); in checkPostStmt()
926 if (CE->getNumArgs() < 2) in checkPostStmt()
928 State = MallocMemAux(C, CE, CE->getArg(1), UndefinedVal(), State); in checkPostStmt()
929 State = ProcessZeroAllocation(C, CE, 1, State); in checkPostStmt()
932 if (CE->getNumArgs() < 2) in checkPostStmt()
939 SVal TotalSize = evalMulForBufferSize(C, CE->getArg(0), CE->getArg(1)); in checkPostStmt()
940 State = MallocMemAux(C, CE, TotalSize, Init, State); in checkPostStmt()
941 State = ProcessZeroAllocation(C, CE, 0, State); in checkPostStmt()
942 State = ProcessZeroAllocation(C, CE, 1, State); in checkPostStmt()
944 if (CE->getNumArgs() < 3) in checkPostStmt()
946 State = ReallocMemAux(C, CE, false, State, true); in checkPostStmt()
947 State = ProcessZeroAllocation(C, CE, 1, State); in checkPostStmt()
948 State = ProcessZeroAllocation(C, CE, 2, State); in checkPostStmt()
959 State = MallocMemReturnsAttr(C, CE, I, State); in checkPostStmt()
963 State = FreeMemAttr(C, CE, I, State); in checkPostStmt()
983 if (const CallExpr *CE = dyn_cast<CallExpr>(E)) { in ProcessZeroAllocation() local
984 Arg = CE->getArg(AllocationSizeArg); in ProcessZeroAllocation()
1216 MallocChecker::MallocMemReturnsAttr(CheckerContext &C, const CallExpr *CE, in MallocMemReturnsAttr() argument
1227 return MallocMemAux(C, CE, CE->getArg(I->getASTIndex()), UndefinedVal(), in MallocMemReturnsAttr()
1230 return MallocMemAux(C, CE, UnknownVal(), UndefinedVal(), State); in MallocMemReturnsAttr()
1234 const CallExpr *CE, in MallocMemAux() argument
1241 return MallocMemAux(C, CE, C.getSVal(SizeEx), Init, State, Family); in MallocMemAux()
1245 const CallExpr *CE, in MallocMemAux() argument
1253 if (!Loc::isLocType(CE->getType())) in MallocMemAux()
1262 DefinedSVal RetVal = svalBuilder.getConjuredHeapSymbolVal(CE, LCtx, Count) in MallocMemAux()
1264 State = State->BindExpr(CE, C.getLocationContext(), RetVal); in MallocMemAux()
1285 return MallocUpdateRefState(C, CE, State, Family); in MallocMemAux()
1314 const CallExpr *CE, in FreeMemAttr() argument
1327 C, CE, State, Arg.getASTIndex(), in FreeMemAttr()
1336 const CallExpr *CE, in FreeMemAux() argument
1345 if (CE->getNumArgs() < (Num + 1)) in FreeMemAux()
1348 return FreeMemAux(C, CE->getArg(Num), CE, State, Hold, in FreeMemAux()
1372 if (const CallExpr *CE = dyn_cast<CallExpr>(S)) { in getAllocationFamily() local
1373 const FunctionDecl *FD = C.getCalleeDecl(CE); in getAllocationFamily()
1376 FD = dyn_cast<FunctionDecl>(CE->getCalleeDecl()); in getAllocationFamily()
1414 if (const CallExpr *CE = dyn_cast<CallExpr>(E)) { in printAllocDeallocName() local
1416 const FunctionDecl *FD = CE->getDirectCallee(); in printAllocDeallocName()
2120 const CallExpr *CE, in ReallocMemAux() argument
2127 if (SuffixWithN && CE->getNumArgs() < 3) in ReallocMemAux()
2129 else if (CE->getNumArgs() < 2) in ReallocMemAux()
2132 const Expr *arg0Expr = CE->getArg(0); in ReallocMemAux()
2144 const Expr *Arg1 = CE->getArg(1); in ReallocMemAux()
2149 TotalSize = evalMulForBufferSize(C, Arg1, CE->getArg(2)); in ReallocMemAux()
2170 ProgramStateRef stateMalloc = MallocMemAux(C, CE, TotalSize, in ReallocMemAux()
2181 SVal RetVal = C.getSVal(CE); in ReallocMemAux()
2190 if (ProgramStateRef stateFree = FreeMemAux(C, CE, StateSizeIsZero, 0, in ReallocMemAux()
2201 FreeMemAux(C, CE, State, 0, false, ReleasedAllocated)) { in ReallocMemAux()
2203 ProgramStateRef stateRealloc = MallocMemAux(C, CE, TotalSize, in ReallocMemAux()
2225 ProgramStateRef MallocChecker::CallocMem(CheckerContext &C, const CallExpr *CE, in CallocMem() argument
2230 if (CE->getNumArgs() < 2) in CallocMem()
2235 SVal TotalSize = evalMulForBufferSize(C, CE->getArg(0), CE->getArg(1)); in CallocMem()
2237 return MallocMemAux(C, CE, TotalSize, zeroVal, State); in CallocMem()