alexshap added inline comments.
================
Comment at: lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:363
case nonloc::LocAsIntegerKind:
return evalBinOpLL(state, op, lhsL,
rhs.castAs<nonloc::LocAsInteger>().getLoc(),
----------------
@NoQ , @dcoughlin
while we are looking at this code - just to double check - is this line (363)
actually correct ?
Let's take a look at the following example:
bool f(long x, double *p1, double *p2) {
long y = (long)p1 - (long) p2;
// or,alternatively (long)p1 * (long)p2 or (long)p1 / (long)p2
return y == x;
}
it looks like again the analyzer will try to use evalBinOpLL and evaluate this
as an operation over pointers, while (if my understanding is correct) we should
be working with integers here (and yes, in most cases it should return
UnknownVal)
Repository:
rL LLVM
https://reviews.llvm.org/D37120
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits