NoQ added inline comments.

================
Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:191
+    }
+    if (from.isMinSignedValue()) {
+      F.add(newRanges, Range(BV.getMinValue(from), BV.getMinValue(from)));
----------------
We'll also need to merge the two adjacent segments if the original range had 
both a [MinSingedValue, MinSignedValue] and a [X, MaxSignedValue]:

{F6287707}

Because our immutable sets are sorted, you can conduct the check for the first 
and the last segment separately.

I think this code needs comments because even though it's short it's pretty 
hard to get right.


================
Comment at: lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:192
+    if (from.isMinSignedValue()) {
+      F.add(newRanges, Range(BV.getMinValue(from), BV.getMinValue(from)));
+    }
----------------
Return value of `add` seems to be accidentally discarded here.

I guess i'll look into adding an `__attribute__((warn_unused_result))` to these 
functions, because it's a super common bug.


https://reviews.llvm.org/D35110



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

Reply via email to