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 | b2242d1b6fe4ae073361e6d8f3db751c95159ca5 (patch) | |
tree | fc78d84cb78b60a1bde59dce1e35b7de927e7cea /lib/Checker/VLASizeChecker.cpp | |
parent | ccbf7eebc8425429e8fd9f9124770f86a74864eb (diff) |
Add comment noting VLASizeChecker's duty in defining a VLA's extent.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107728 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/VLASizeChecker.cpp')
-rw-r--r-- | lib/Checker/VLASizeChecker.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Checker/VLASizeChecker.cpp b/lib/Checker/VLASizeChecker.cpp index b25843c45b..936991d613 100644 --- a/lib/Checker/VLASizeChecker.cpp +++ b/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(); |