On Apr 4, 2013, at 16:46 , Anton Yartsev <[email protected]> wrote:
> + if (Family == AF_Malloc &&
> + (!Filter.CMallocOptimistic && !Filter.CMallocPessimistic))
> + return false;
> +
> + if ((Family == AF_CXXNew || Family == AF_CXXNewArray) &&
> + !Filter.CNewDeleteChecker)
> + return false;
> +
> + return true;
> +}
> +
> +bool MallocChecker::isTrackedFamily(CheckerContext &C,
> + const Stmt *AllocDeallocStmt) const {
> + return isTrackedFamily(getAllocationFamily(C, AllocDeallocStmt));
> +}
> +
> +bool MallocChecker::isTrackedFamily(CheckerContext &C, SymbolRef Sym) const {
> + const RefState *RS = C.getState()->get<RegionState>(Sym);
> +
> + return RS ? isTrackedFamily(RS->getAllocationFamily())
> + : isTrackedFamily(AF_None);
> +}
Uh, this is not correct; this will say that AF_None is a tracked family, which
means any symbol with no RefState has a tracked family.
A (fully-covered) switch statement might also be safer than the series of ifs,
because then we won't forget to update it later.
Jordan
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits