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

Anton Yartsev anton.yartsev at gmail.com
Thu Apr 9 08:11:22 PDT 2015


On 05.04.2015 7:16, Anna Zaks wrote:
> 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.
Ran the checker over LLVM and Ogre codebases, neither false-positives 
nor issues found except for one artificially injected issue. Ok to commit?

>
> 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 
> <mailto: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.
Added several realloc() tests with TODO comments.

>     http://reviews.llvm.org/D8273
>
>     EMAIL PREFERENCES
>     http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>


-- 
Anton

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150409/e2ec64b0/attachment.html>


More information about the cfe-commits mailing list