baloghadamsoftware added a comment.

This patch definitely reduces the number of false positives, but may not be 
enough. The problem is that `std::advance()` may call another function that 
does the actual incremention or decremention, in the `gcc` implementation it is 
`__advance()`. If the `std::advance()` is inlined but `__advance()` not then we 
still get false positive. The obvious way would be to simulate `__advance()` as 
well but it is an implementation dependent internal function and may be totally 
different for other implementations. Another idea is that instead of querying 
the `CheckerContext` whether `advance()` was inlined we go up the exploded 
graph and find its "precall" state and compare the values of the first 
parameter related to the second one in the two states. This is a bit more 
complex and more expensive but this for me this seems to be the correct 
solution.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62895/new/

https://reviews.llvm.org/D62895



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D62895: [Analyzer] ... Balogh, Ádám via Phabricator via cfe-commits
    • [PATCH] D62895: [Analy... Balogh, Ádám via Phabricator via cfe-commits

Reply via email to