]> granicus.if.org Git - clang/commitdiff
Add comment noting VLASizeChecker's duty in defining a VLA's extent.
authorJordy Rose <jediknil@belkadan.com>
Tue, 6 Jul 2010 23:33:54 +0000 (23:33 +0000)
committerJordy Rose <jediknil@belkadan.com>
Tue, 6 Jul 2010 23:33:54 +0000 (23:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107728 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/VLASizeChecker.cpp

index b25843c45b2f6aded08f470425456a62dd3fedf7..936991d6133c051380a686b1246913734c5109e9 100644 (file)
@@ -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();