ASDenysPetrov added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1686-1689
+  // Array's declaration should have an initializer.
+  const Expr *Init = VD->getAnyInitializer();
+  if (!Init)
+    return None;
----------------
ASDenysPetrov wrote:
> steakhal wrote:
> > This should have been checked at L1642 to preserve the original behavior.
> > As of now, the code might return `UndefinedVal` at L1683 or `Unknown` at 
> > L1659, which is probably different than the original behavior - unless you 
> > prove otherwise.
> `Unknown` at L1659 comes from 
> `RegionStoreManager::getBindingForFieldOrElementCommon`. As you can see, 
> there is a snippet in here:
> ```
>     if (hasSymbolicIndex)
>       return UnknownVal();
> ```
> 
UndefinedVal at L1683 preserves exactly the previous behaviour.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106681

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

Reply via email to