]> granicus.if.org Git - clang/commitdiff
Sink variable into assert
authorMatt Beaumont-Gay <matthewbg@google.com>
Mon, 13 Feb 2012 19:29:45 +0000 (19:29 +0000)
committerMatt Beaumont-Gay <matthewbg@google.com>
Mon, 13 Feb 2012 19:29:45 +0000 (19:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150407 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprCXX.cpp

index 4962bf4b92cdd2d0957f3362c04fec3fd0d5eba3..4d9f05a0289cccb67b0e392020e210a07999fe79 100644 (file)
@@ -857,11 +857,11 @@ LambdaExpr::capture_iterator LambdaExpr::implicit_capture_end() const {
 
 ArrayRef<VarDecl *> 
 LambdaExpr::getCaptureInitIndexVars(capture_init_iterator Iter) const {
-  CXXRecordDecl::LambdaDefinitionData &Data = getLambdaClass()->getLambdaData();
   assert(HasArrayIndexVars && "No array index-var data?");
   
   unsigned Index = Iter - capture_init_begin();
-  assert(Index < Data.NumCaptures && "Capture index out-of-range");
+  assert(Index < getLambdaClass()->getLambdaData().NumCaptures &&
+         "Capture index out-of-range");
   VarDecl **IndexVars = getArrayIndexVars();
   unsigned *IndexStarts = getArrayIndexStarts();
   return ArrayRef<VarDecl *>(IndexVars + IndexStarts[Index],