Charusso added a comment.

In overall I wanted to keep the [A, B] shape of the tests, but now they are 
more precise, thanks!



================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:503
+
+  if (!BinaryOperator::isBitwiseOrShiftOp(SIE->getOpcode()))
+    return State;
----------------
NoQ wrote:
> I suspect we have problems with bitwise OR here, which (unlike other 
> bitwise/shift ops) may be true when the LHS is 0.
Whoops, thanks!


================
Comment at: clang/test/Analysis/bitwise-ranges.cpp:28
+  unsigned int D = X << 1;
+  clang_analyzer_eval((D >= 1 && D <= 4294967295) || D == 0);
+  // expected-warning@-1 {{TRUE}}
----------------
NoQ wrote:
> This check is trivially true regardless of the value of D or constraints on 
> it.
Hm, yes. I felt like `D` equals to `E`, but that test fails, so I have just 
removed them.


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

https://reviews.llvm.org/D65239



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to