[PATCH v2] Bug 14526 - Make malloc() static analysis M_ZERO-aware

Jordan Rose jordan_rose at apple.com
Thu Mar 20 09:21:42 PDT 2014

On Mar 20, 2014, at 4:49 , Meyer, Conrad <conrad.meyer at isilon.com> wrote:

>> This could be unknown if the argument value is unknown (i.e. the
>> analyzer has failed to symbolize it for some reason). In that case, we
>> should probably still treat this as a regular malloc.
> Agreed. It's probably obvious, but I'm not super familiar with Clang internals — should we also consider the previous case (!V.getAs<NonLoc>()) as regular malloc as well?

I think if we ever see a location in this position, that means malloc() isn't declared the way we think it is. I'm not sure what the most conservative behavior would be in that case, but not trying to track anything seems sensible. Getting Unknown, though, is entirely possible just because of limitations in the analyzer's reasoning power, even though it happens very rarely these days. Leaving it the way it is seems fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140320/7b9e78fc/attachment.html>

More information about the cfe-commits mailing list