steakhal added a comment.

Why does `glob_invalid_index7()` and `glob_invalid_index8()` differ in behavior?
I would expect that the analyzer produces the same `Loc` symbolic value for 
both cases thus, the array access should result in the same behavior regardless 
if `glob_arr6` is used, or acquired a pointer and using that in a subsequent 
operation.
Could you elaborate on this?



================
Comment at: clang/lib/StaticAnalyzer/Core/RegionStore.cpp:1642
+  //
+  // Previous check for `Idx < 0` guarantee that `Idx` is non-negative.
+  const auto I = static_cast<size_t>(Idx.getExtValue());
----------------
Instead of this comment, you can put an `assert(Idx.isStrictlyPositive())` here.


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

https://reviews.llvm.org/D107339

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

Reply via email to