[PATCH] D99797: [analyzer] Handle intersections and adjacency in RangeSet::Factory::add function

Valeriy Savchenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 3 03:28:57 PDT 2021


vsavchenko added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp:138-139
 
-  return makePersistent(std::move(Result));
-}
+  if (!Original.pin(From, To))
+    return getEmptySet();
 
----------------
ASDenysPetrov wrote:
> This allows to add a RangeSet of any type. E.g. RangeSet(uchar) + RangeSet(int) = valid, because of `pin`
> 
> I'm wondering whether we really need it here in practice?
We mix ranges of different types way more than one would expect.


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

https://reviews.llvm.org/D99797



More information about the cfe-commits mailing list