[PATCH] D80903: [analyzer] Ignore calculated indices of <= 0 in VLASizeChecker

Vince Bridgers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 1 17:22:01 PDT 2020


vabridgers added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp:114-115
     // Convert the array length to size_t.
     NonLoc IndexLength =
         SVB.evalCast(SizeD, SizeTy, SizeE->getType()).castAs<NonLoc>();
     // Multiply the array length by the element size.
----------------
NoQ wrote:
> Do i understand correctly that this cast is the only difference between the value that has been checked and the value on which the assertion is asserted?
Yes, looks that way to me. Let's see if Balasz, Gabor, Adam or Kristof responds in the next day or two? Thanks Artem!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80903





More information about the cfe-commits mailing list