[PATCH] D9924: Ignore report when the argument to malloc is assigned known value

Aditya K via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 17 17:12:03 PDT 2015



----------------------------------------
> Date: Mon, 17 Aug 2015 21:39:32 +0000
> To: hiraditya at msn.com; jordan_rose at apple.com; kremenek at apple.com; daniel.marjamaki at evidente.se; mclow.lists at gmail.com; adasgupt at codeaurora.org; zaks.anna at gmail.com
> From: zaks.anna at gmail.com
> CC: cfe-commits at lists.llvm.org
> Subject: Re: [PATCH] D9924: Ignore report when the argument to malloc is assigned known value
>
> zaks.anna added a comment.
>
>> Maybe, I should add a check that `a, b, n' are positive.
>
>> So, in this case static analyzer can choose to be strict and reject false positives.
>
>
> What would this buy us? Does the checker warn on underflow?

I mean, checking `a,b,n' are positive would ensure that there is no overflow in this case and then we would not emit report.
The checker does not warn on underflow, so we can ignore checking `a,b,n' are positive, if it is too complicated.

>
>> If a' might overflow, then in this case we can emit warning stating that the overflow is caused because a' might overflow.
>
>
> I see your point now! I think we should improve the diagnostic that is produced in this case!

I'm trying to implement that.
Thanks,
-Aditya

>
>
> http://reviews.llvm.org/D9924
>
>
>
 		 	   		  


More information about the cfe-commits mailing list