[clang] [analyzer] `canReasonAbout` does not support `nonloc::LazyCompoundVal` (PR #87521)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 13 12:07:48 PDT 2024


================
@@ -2836,6 +2836,10 @@ bool RangeConstraintManager::canReasonAbout(SVal X) const {
     return false;
   }
 
+  // Non-integer types are not supported.
+  if (X.getAs<nonloc::LazyCompoundVal>())
+    return false;
+
----------------
steakhal wrote:

My problem with this is that I think LCVs shouldn't even appear here.
And even if they could, why don't we also handle `nonloc::CompoundVals` too? They are basically the same thing, except for the lazyness.

So, this patch masks some fundamental problem somewhere else - probably within the iterator checker or container modeling, actually passing an LCV.
But I get it, its better to not crash, sure.

I'd be happy to merge this and creating a new ticket for investigating what's going on.

https://github.com/llvm/llvm-project/pull/87521


More information about the cfe-commits mailing list