Lines Matching defs:sym
291 bool isReleased(SymbolRef Sym, CheckerContext &C) const;
293 bool checkUseAfterFree(SymbolRef Sym, CheckerContext &C, const Stmt *S) const;
295 bool checkDoubleDelete(SymbolRef Sym, CheckerContext &C) const;
325 Optional<CheckKind> getCheckIfTracked(CheckerContext &C, SymbolRef Sym) const;
333 SymbolRef Sym, bool OwnershipTransferred) const;
338 SymbolRef Sym) const;
340 SymbolRef Sym, SymbolRef PrevSym) const;
342 void ReportDoubleDelete(CheckerContext &C, SymbolRef Sym) const;
344 /// Find the location of the allocation for Sym on the path leading to the
346 LeakInfo getAllocationSite(const ExplodedNode *N, SymbolRef Sym,
349 void reportLeak(SymbolRef Sym, ExplodedNode *N, CheckerContext &C) const;
362 SymbolRef Sym;
374 : Sym(S), Mode(Normal), FailedReallocSymbol(nullptr), IsLeak(isLeak) {}
381 ID.AddPointer(Sym);
478 bool VisitSymbol(SymbolRef sym) override {
479 state = state->remove<RegionState>(sym);
762 if (SymbolRef Sym = C.getSVal(*I).getAsSymbol())
763 checkUseAfterFree(Sym, C, *I);
782 if (SymbolRef Sym = C.getSVal(DE->getArgument()).getAsSymbol())
783 checkUseAfterFree(Sym, C, DE->getArgument());
909 SymbolRef Sym = retVal.getAsLocSymbol();
910 assert(Sym);
913 return State->set<RegionState>(Sym, RefState::getAllocated(Family, E));
952 SymbolRef Sym, SymbolRef &RetStatusSymbol) {
953 const SymbolRef *Ret = State->get<FreeReturnValue>(Sym);
1233 MallocChecker::getCheckIfTracked(CheckerContext &C, SymbolRef Sym) const {
1235 const RefState *RS = C.getState()->get<RegionState>(Sym);
1382 SymbolRef Sym,
1426 R->markInteresting(Sym);
1428 R->addVisitor(new MallocBugVisitor(Sym));
1491 SymbolRef Sym) const {
1498 Optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(C, Sym);
1510 R->markInteresting(Sym);
1512 R->addVisitor(new MallocBugVisitor(Sym));
1518 bool Released, SymbolRef Sym,
1526 Optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(C, Sym);
1541 R->markInteresting(Sym);
1544 R->addVisitor(new MallocBugVisitor(Sym));
1549 void MallocChecker::ReportDoubleDelete(CheckerContext &C, SymbolRef Sym) const {
1554 Optional<MallocChecker::CheckKind> CheckKind = getCheckIfTracked(C, Sym);
1567 R->markInteresting(Sym);
1568 R->addVisitor(new MallocBugVisitor(Sym));
1692 MallocChecker::getAllocationSite(const ExplodedNode *N, SymbolRef Sym,
1702 if (!State->get<RegionState>(Sym))
1710 if (Val.getAsLocSymbol() == Sym) {
1731 void MallocChecker::reportLeak(SymbolRef Sym, ExplodedNode *N,
1739 const RefState *RS = C.getState()->get<RegionState>(Sym);
1770 std::tie(AllocNode, Region) = getAllocationSite(N, Sym, C);
1795 R->markInteresting(Sym);
1796 R->addVisitor(new MallocBugVisitor(Sym, true));
1857 SymbolRef Sym = DC->getCXXThisVal().getAsSymbol();
1858 if (!Sym || checkDoubleDelete(Sym, C))
1880 SymbolRef Sym = CC->getCXXThisVal().getAsSymbol();
1881 if (!Sym || checkUseAfterFree(Sym, C, CC->getCXXThisExpr()))
1889 SymbolRef Sym = ArgSVal.getAsSymbol();
1890 if (!Sym)
1892 if (checkUseAfterFree(Sym, C, Call.getArgExpr(I)))
1906 SymbolRef Sym = RetVal.getAsSymbol();
1907 if (!Sym)
1915 Sym = BMR->getSymbol();
1918 if (Sym)
1919 checkUseAfterFree(Sym, C, E);
1962 bool MallocChecker::isReleased(SymbolRef Sym, CheckerContext &C) const {
1963 assert(Sym);
1964 const RefState *RS = C.getState()->get<RegionState>(Sym);
1968 bool MallocChecker::checkUseAfterFree(SymbolRef Sym, CheckerContext &C,
1971 if (isReleased(Sym, C)) {
1972 ReportUseAfterFree(C, S->getSourceRange(), Sym);
1979 bool MallocChecker::checkDoubleDelete(SymbolRef Sym, CheckerContext &C) const {
1981 if (isReleased(Sym, C)) {
1982 ReportDoubleDelete(C, Sym);
1991 SymbolRef Sym = l.getLocSymbolInBase();
1992 if (Sym)
1993 checkUseAfterFree(Sym, C, S);
2231 SymbolRef sym = *I;
2233 if (EscapingSymbol && EscapingSymbol != sym)
2236 if (const RefState *RS = State->get<RegionState>(sym)) {
2238 State = State->remove<RegionState>(sym);
2239 State = State->set<RegionState>(sym, RefState::getEscaped(RS));
2253 SymbolRef sym = I.getKey();
2254 if (!currMap.lookup(sym))
2255 return sym;
2269 const RefState *RS = state->get<RegionState>(Sym);
2270 const RefState *RSPrev = statePrev->get<RegionState>(Sym);
2300 StackHint = new StackHintGeneratorForSymbol(Sym,
2304 StackHint = new StackHintGeneratorForSymbol(Sym,
2308 StackHint = new StackHintGeneratorForSymbol(Sym, "");
2312 StackHint = new StackHintGeneratorForReallocationFailed(Sym,
2315 if (SymbolRef sym = findFailedReallocSymbol(state, statePrev)) {
2317 assert((!FailedReallocSymbol || FailedReallocSymbol == sym) &&
2319 BR.markInteresting(sym);
2320 FailedReallocSymbol = sym;
2332 StackHint = new StackHintGeneratorForSymbol(Sym,