martong added inline comments.
================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:1289-1291
+      auto It = llvm::find_if(*CM, [MinBitWidth](CastMap::value_type &Item) {
+        return Item.first >= MinBitWidth;
+      });
----------------
There might be a problem here because the iteration of the map is 
non-deterministic. We should probably have a copy that is sorted, or the 
container should be sorted (sorted immutable list maybe?).

Your tests below passed probably because the cast chains are too small. Could 
you please have a test, where the chain is really long (20 maybe) and shuffled.
(My thanks for @steakhal for this additional comment.)


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:2300-2303
+    for (auto &Item : *CM) {
+      // Stop after reaching a bigger bitwidth.
+      if (Item.first > MinBitWidth)
+        break;
----------------
Same here.


================
Comment at: clang/test/Analysis/symbol-integral-cast.cpp:31
+  if (!s) {
+    if (x == 65537)
+      clang_analyzer_warnIfReached(); // no-warning
----------------



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

https://reviews.llvm.org/D103096

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

Reply via email to