[PATCH] D39049: [analyzer] Fix wrong calculation of offset in ArrayBoundsV2

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 21 04:14:27 PST 2017


xazax.hun requested changes to this revision.
xazax.hun added a comment.
This revision now requires changes to proceed.

In https://reviews.llvm.org/D39049#928620, @danielmarjamaki wrote:

>   > So what are the arguments that are passed to getSimplifiedOffset() in that case? 0? That does not seem to be correct.
>   
>
> yes.


Maybe I am missing something but this does not seem to be correct for me. We should either have the correct symbolic expression or UnknownVal if the analyzer cannot reason about something (or UndefVal if the result is undefined). But never the wrong value. 
If you are sure that this happens, this needs to be investigated.

> so the conclusion is:
> 
> - this code does not work
> - this code is untested
> - this code is not even used in the use cases it was intended for because of bugs elsewhere
> 
>   therefore it should be removed.

I am ok with removing that code AND altering the comment to reflect the changes. Please update this patch accordingly. 
Also, I think maybe an easier test case could be added to show what is wrong with the current approach.


Repository:
  rL LLVM

https://reviews.llvm.org/D39049





More information about the cfe-commits mailing list