[PATCH] [analyzer] Implementation of potential undefbehavior.ZeroAllocDereference checker.

Anna Zaks zaks.anna at gmail.com
Sat Apr 4 21:16:48 PDT 2015


Hi Anton,

Have you tested the patch on anything but the regression tests? If yes,
what are the results? Did this catch any issues? Are there any false
positives? Since this will be a turned on by default new warning, I'd like
make sure we test on real code before committing.

Other than testing, this looks good to me. Thank you!
Anna.

On Sat, Mar 21, 2015 at 7:19 AM, Антон Ярцев <anton.yartsev at gmail.com>
wrote:

> .
>
>
> ================
> Comment at: lib/StaticAnalyzer/Checkers/MallocChecker.cpp:889
> @@ +888,3 @@
> +    const RefState *RS = State->get<RegionState>(Sym);
> +    if (!RS || !RS->isAllocated())
> +      return State;
> ----------------
> ayartsev wrote:
> > zaks.anna wrote:
> > > It should not be possible to have non allocated symbol here.. Is it?
> Maybe we should assert?
> > Agree, done!
> Pardon, currently zero-allocated realloc do not attach a RefState so it is
> still early to assert for now.
>
>
Is there a test for this? If not, please add one.


> http://reviews.llvm.org/D8273
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150404/640c3c3d/attachment.html>


More information about the cfe-commits mailing list