Lines Matching refs:MallocChecker
299 class MallocChecker class
395 using CheckFn = std::function<void(const MallocChecker *,
401 {{CDM::CLibrary, {"getline"}, 3}, &MallocChecker::preGetdelim},
402 {{CDM::CLibrary, {"getdelim"}, 4}, &MallocChecker::preGetdelim},
406 {{CDM::CLibrary, {"free"}, 1}, &MallocChecker::checkFree},
408 &MallocChecker::checkIfFreeNameIndex},
409 {{CDM::CLibrary, {"kfree"}, 1}, &MallocChecker::checkFree},
410 {{CDM::CLibrary, {"g_free"}, 1}, &MallocChecker::checkFree},
419 {{CDM::CLibrary, {"alloca"}, 1}, &MallocChecker::checkAlloca},
420 {{CDM::CLibrary, {"_alloca"}, 1}, &MallocChecker::checkAlloca},
425 &MallocChecker::checkAlloca},
426 {{CDM::CLibrary, {"malloc"}, 1}, &MallocChecker::checkBasicAlloc},
427 {{CDM::CLibrary, {"malloc"}, 3}, &MallocChecker::checkKernelMalloc},
428 {{CDM::CLibrary, {"calloc"}, 2}, &MallocChecker::checkCalloc},
429 {{CDM::CLibrary, {"valloc"}, 1}, &MallocChecker::checkBasicAlloc},
430 {{CDM::CLibrary, {"strndup"}, 2}, &MallocChecker::checkStrdup},
431 {{CDM::CLibrary, {"strdup"}, 1}, &MallocChecker::checkStrdup},
432 {{CDM::CLibrary, {"_strdup"}, 1}, &MallocChecker::checkStrdup},
433 {{CDM::CLibrary, {"kmalloc"}, 2}, &MallocChecker::checkKernelMalloc},
434 {{CDM::CLibrary, {"if_nameindex"}, 1}, &MallocChecker::checkIfNameIndex},
435 {{CDM::CLibrary, {"wcsdup"}, 1}, &MallocChecker::checkStrdup},
436 {{CDM::CLibrary, {"_wcsdup"}, 1}, &MallocChecker::checkStrdup},
437 {{CDM::CLibrary, {"g_malloc"}, 1}, &MallocChecker::checkBasicAlloc},
438 {{CDM::CLibrary, {"g_malloc0"}, 1}, &MallocChecker::checkGMalloc0},
439 {{CDM::CLibrary, {"g_try_malloc"}, 1}, &MallocChecker::checkBasicAlloc},
440 {{CDM::CLibrary, {"g_try_malloc0"}, 1}, &MallocChecker::checkGMalloc0},
441 {{CDM::CLibrary, {"g_memdup"}, 2}, &MallocChecker::checkGMemdup},
442 {{CDM::CLibrary, {"g_malloc_n"}, 2}, &MallocChecker::checkGMallocN},
443 {{CDM::CLibrary, {"g_malloc0_n"}, 2}, &MallocChecker::checkGMallocN0},
444 {{CDM::CLibrary, {"g_try_malloc_n"}, 2}, &MallocChecker::checkGMallocN},
445 {{CDM::CLibrary, {"g_try_malloc0_n"}, 2}, &MallocChecker::checkGMallocN0},
450 std::bind(&MallocChecker::checkRealloc, _1, _2, _3, false)},
452 std::bind(&MallocChecker::checkRealloc, _1, _2, _3, true)},
454 std::bind(&MallocChecker::checkRealloc, _1, _2, _3, false)},
456 std::bind(&MallocChecker::checkRealloc, _1, _2, _3, false)},
457 {{CDM::CLibrary, {"g_realloc_n"}, 3}, &MallocChecker::checkReallocN},
458 {{CDM::CLibrary, {"g_try_realloc_n"}, 3}, &MallocChecker::checkReallocN},
462 {{CDM::CLibrary, {"getline"}, 3}, &MallocChecker::checkGetdelim},
463 {{CDM::CLibrary, {"getdelim"}, 4}, &MallocChecker::checkGetdelim},
777 const auto *MallocChk = static_cast<const MallocChecker *>(&Checker); in isFreeingCallAsWritten()
784 return MallocChecker::isFreeingOwnershipAttrCall(Func); in isFreeingCallAsWritten()
831 NoMemOwnershipChangeVisitor(SymbolRef Sym, const MallocChecker *Checker) in NoMemOwnershipChangeVisitor()
1012 bool MallocChecker::isFreeingOwnershipAttrCall(const FunctionDecl *Func) { in isFreeingOwnershipAttrCall()
1023 bool MallocChecker::isFreeingCall(const CallEvent &Call) const { in isFreeingCall()
1033 bool MallocChecker::isMemCall(const CallEvent &Call) const { in isMemCall()
1046 MallocChecker::performKernelMalloc(const CallEvent &Call, CheckerContext &C, in performKernelMalloc()
1131 SVal MallocChecker::evalMulForBufferSize(CheckerContext &C, const Expr *Blocks, in evalMulForBufferSize()
1142 void MallocChecker::checkBasicAlloc(const CallEvent &Call, in checkBasicAlloc()
1151 void MallocChecker::checkKernelMalloc(const CallEvent &Call, in checkKernelMalloc()
1186 void MallocChecker::checkRealloc(const CallEvent &Call, CheckerContext &C, in checkRealloc()
1202 void MallocChecker::checkCalloc(const CallEvent &Call, in checkCalloc()
1211 void MallocChecker::checkFree(const CallEvent &Call, CheckerContext &C) const { in checkFree()
1221 void MallocChecker::checkAlloca(const CallEvent &Call, in checkAlloca()
1230 void MallocChecker::checkStrdup(const CallEvent &Call, in checkStrdup()
1241 void MallocChecker::checkIfNameIndex(const CallEvent &Call, in checkIfNameIndex()
1252 void MallocChecker::checkIfFreeNameIndex(const CallEvent &Call, in checkIfFreeNameIndex()
1261 void MallocChecker::checkCXXNewOrCXXDelete(const CallEvent &Call, in checkCXXNewOrCXXDelete()
1302 void MallocChecker::checkGMalloc0(const CallEvent &Call, in checkGMalloc0()
1312 void MallocChecker::checkGMemdup(const CallEvent &Call, in checkGMemdup()
1321 void MallocChecker::checkGMallocN(const CallEvent &Call, in checkGMallocN()
1332 void MallocChecker::checkGMallocN0(const CallEvent &Call, in checkGMallocN0()
1350 void MallocChecker::preGetdelim(const CallEvent &Call, in preGetdelim()
1373 void MallocChecker::checkGetdelim(const CallEvent &Call, in checkGetdelim()
1400 void MallocChecker::checkReallocN(const CallEvent &Call, in checkReallocN()
1410 void MallocChecker::checkOwnershipAttr(const CallEvent &Call, in checkOwnershipAttr()
1439 void MallocChecker::checkPostCall(const CallEvent &Call, in checkPostCall()
1472 ProgramStateRef MallocChecker::ProcessZeroAllocCheck( in ProcessZeroAllocCheck()
1577 MallocChecker::processNewAllocation(const CXXAllocatorCall &Call, in processNewAllocation()
1609 void MallocChecker::checkNewAllocator(const CXXAllocatorCall &Call, in checkNewAllocator()
1642 void MallocChecker::checkPostObjCMessage(const ObjCMethodCall &Call, in checkPostObjCMessage()
1667 MallocChecker::MallocMemReturnsAttr(CheckerContext &C, const CallEvent &Call, in MallocMemReturnsAttr()
1684 ProgramStateRef MallocChecker::MallocMemAux(CheckerContext &C, in MallocMemAux()
1696 void MallocChecker::reportTaintBug(StringRef Msg, ProgramStateRef State, in reportTaintBug()
1713 void MallocChecker::checkTaintedness(CheckerContext &C, const CallEvent &Call, in checkTaintedness()
1752 ProgramStateRef MallocChecker::MallocMemAux(CheckerContext &C, in MallocMemAux()
1826 ProgramStateRef MallocChecker::FreeMemAttr(CheckerContext &C, in FreeMemAttr()
1849 ProgramStateRef MallocChecker::FreeMemAux(CheckerContext &C, in FreeMemAux()
1945 MallocChecker::FreeMemAux(CheckerContext &C, const Expr *ArgExpr, in FreeMemAux()
2119 std::optional<MallocChecker::CheckKind>
2120 MallocChecker::getCheckIfTracked(AllocationFamily Family, in getCheckIfTracked()
2154 std::optional<MallocChecker::CheckKind>
2155 MallocChecker::getCheckIfTracked(CheckerContext &C, SymbolRef Sym, in getCheckIfTracked()
2165 bool MallocChecker::SummarizeValue(raw_ostream &os, SVal V) { in SummarizeValue()
2180 bool MallocChecker::SummarizeRegion(raw_ostream &os, in SummarizeRegion()
2254 void MallocChecker::HandleNonHeapDealloc(CheckerContext &C, SVal ArgVal, in HandleNonHeapDealloc()
2264 std::optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(Family); in HandleNonHeapDealloc()
2302 void MallocChecker::HandleFreeAlloca(CheckerContext &C, SVal ArgVal, in HandleFreeAlloca()
2305 std::optional<MallocChecker::CheckKind> CheckKind; in HandleFreeAlloca()
2330 void MallocChecker::HandleMismatchedDealloc(CheckerContext &C, in HandleMismatchedDealloc()
2387 void MallocChecker::HandleOffsetFree(CheckerContext &C, SVal ArgVal, in HandleOffsetFree()
2397 std::optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(Family); in HandleOffsetFree()
2445 void MallocChecker::HandleUseAfterFree(CheckerContext &C, SourceRange Range, in HandleUseAfterFree()
2454 std::optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(C, Sym); in HandleUseAfterFree()
2484 void MallocChecker::HandleDoubleFree(CheckerContext &C, SourceRange Range, in HandleDoubleFree()
2493 std::optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(C, Sym); in HandleDoubleFree()
2516 void MallocChecker::HandleDoubleDelete(CheckerContext &C, SymbolRef Sym) const { in HandleDoubleDelete()
2523 std::optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(C, Sym); in HandleDoubleDelete()
2542 void MallocChecker::HandleUseZeroAlloc(CheckerContext &C, SourceRange Range, in HandleUseZeroAlloc()
2550 std::optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(C, Sym); in HandleUseZeroAlloc()
2574 void MallocChecker::HandleFunctionPtrFree(CheckerContext &C, SVal ArgVal, in HandleFunctionPtrFree()
2583 std::optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(Family); in HandleFunctionPtrFree()
2614 MallocChecker::ReallocMemAux(CheckerContext &C, const CallEvent &Call, in ReallocMemAux()
2722 ProgramStateRef MallocChecker::CallocMem(CheckerContext &C, in CallocMem()
2739 MallocChecker::LeakInfo MallocChecker::getAllocationSite(const ExplodedNode *N, in getAllocationSite()
2780 void MallocChecker::HandleLeak(SymbolRef Sym, ExplodedNode *N, in HandleLeak()
2794 std::optional<MallocChecker::CheckKind> CheckKind = in HandleLeak()
2845 void MallocChecker::checkDeadSymbols(SymbolReaper &SymReaper, in checkDeadSymbols()
2903 void MallocChecker::checkPreCall(const CallEvent &Call, in checkPreCall()
2969 void MallocChecker::checkPreStmt(const ReturnStmt *S, in checkPreStmt()
2977 void MallocChecker::checkEndFunction(const ReturnStmt *S, in checkEndFunction()
2982 void MallocChecker::checkEscapeOnReturn(const ReturnStmt *S, in checkEscapeOnReturn()
3013 void MallocChecker::checkPostStmt(const BlockExpr *BE, in checkPostStmt()
3052 bool MallocChecker::suppressDeallocationsInSuspiciousContexts( in suppressDeallocationsInSuspiciousContexts()
3081 bool MallocChecker::checkUseAfterFree(SymbolRef Sym, CheckerContext &C, in checkUseAfterFree()
3092 void MallocChecker::checkUseZeroAllocated(SymbolRef Sym, CheckerContext &C, in checkUseZeroAllocated()
3105 bool MallocChecker::checkDoubleDelete(SymbolRef Sym, CheckerContext &C) const { in checkDoubleDelete()
3115 void MallocChecker::checkLocation(SVal l, bool isLoad, const Stmt *S, in checkLocation()
3126 ProgramStateRef MallocChecker::evalAssume(ProgramStateRef state, in evalAssume()
3170 bool MallocChecker::mayFreeAnyEscapedMemoryOrIsModeledExplicitly( in mayFreeAnyEscapedMemoryOrIsModeledExplicitly()
3334 ProgramStateRef MallocChecker::checkPointerEscape(ProgramStateRef State, in checkPointerEscape()
3342 ProgramStateRef MallocChecker::checkConstPointerEscape(ProgramStateRef State, in checkConstPointerEscape()
3356 ProgramStateRef MallocChecker::checkPointerEscapeAux( in checkPointerEscapeAux()
3382 bool MallocChecker::isArgZERO_SIZE_PTR(ProgramStateRef State, CheckerContext &C, in isArgZERO_SIZE_PTR()
3622 void MallocChecker::printState(raw_ostream &Out, ProgramStateRef State, in printState()
3632 std::optional<MallocChecker::CheckKind> CheckKind = in printState()
3664 MallocChecker *checker = mgr.getChecker<MallocChecker>(); in registerInnerPointerCheckerAux()
3665 checker->ChecksEnabled[MallocChecker::CK_InnerPointerChecker] = true; in registerInnerPointerCheckerAux()
3666 checker->CheckNames[MallocChecker::CK_InnerPointerChecker] = in registerInnerPointerCheckerAux()
3671 auto *checker = mgr.registerChecker<MallocChecker>(); in registerDynamicMemoryModeling()
3685 MallocChecker *checker = mgr.getChecker<MallocChecker>(); \
3686 checker->ChecksEnabled[MallocChecker::CK_##name] = true; \
3687 checker->CheckNames[MallocChecker::CK_##name] = \
3693 REGISTER_CHECKER(MallocChecker)