diff options
author | Jordy Rose <jediknil@belkadan.com> | 2010-07-06 23:33:54 +0000 |
---|---|---|
committer | Jordy Rose <jediknil@belkadan.com> | 2010-07-06 23:33:54 +0000 |
commit | cf781e543006cb7e7e26e4c2d674659d586eb05d (patch) | |
tree | 753aea7793fb5a2d183fb61c3f1861ac6d691680 /clang/lib/Checker/VLASizeChecker.cpp | |
parent | ce656633304f88fb7e0fa3cb0c6660a4b6cc0bd5 (diff) | |
download | bcm5719-llvm-cf781e543006cb7e7e26e4c2d674659d586eb05d.tar.gz bcm5719-llvm-cf781e543006cb7e7e26e4c2d674659d586eb05d.zip |
Add comment noting VLASizeChecker's duty in defining a VLA's extent.
llvm-svn: 107728
Diffstat (limited to 'clang/lib/Checker/VLASizeChecker.cpp')
-rw-r--r-- | clang/lib/Checker/VLASizeChecker.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Checker/VLASizeChecker.cpp b/clang/lib/Checker/VLASizeChecker.cpp index b25843c45b2..936991d6133 100644 --- a/clang/lib/Checker/VLASizeChecker.cpp +++ b/clang/lib/Checker/VLASizeChecker.cpp @@ -9,6 +9,8 @@ // // This defines VLASizeChecker, a builtin check in GRExprEngine that // performs checks for declaration of VLA of undefined or zero size. +// In addition, VLASizeChecker is responsible for defining the extent +// of the MemRegion that represents a VLA. // //===----------------------------------------------------------------------===// @@ -100,6 +102,10 @@ void VLASizeChecker::PreVisitDeclStmt(CheckerContext &C, const DeclStmt *DS) { // From this point on, assume that the size is not zero. state = stateNotZero; + // VLASizeChecker is responsible for defining the extent of the array being + // declared. We do this by multiplying the array length by the element size, + // then matching that with the array region's extent symbol. + // Convert the array length to size_t. ValueManager &ValMgr = C.getValueManager(); SValuator &SV = ValMgr.getSValuator(); |