Fixed deadcode bug where check for NULL decl occured within a block
where the decl would always be non-NULL.  Moved the check to after the
block to properly tidy up the iterator's state.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43473 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/StmtIterator.cpp b/AST/StmtIterator.cpp
index 9db5f61..89d17bd 100644
--- a/AST/StmtIterator.cpp
+++ b/AST/StmtIterator.cpp
@@ -31,6 +31,7 @@
 
 void StmtIteratorBase::NextVA() {
   assert (getVAPtr());
+  assert (decl);
 
   VariableArrayType* p = getVAPtr();
   p = FindVA(p->getElementType().getTypePtr());
@@ -59,11 +60,6 @@
   }    
   
   for ( ; decl ; decl = decl->getNextDeclarator()) {
-    if (!decl) {
-      RawVAPtr = 0;
-      return;
-    }
-
     if (VarDecl* VD = dyn_cast<VarDecl>(decl)) {        
       if (VariableArrayType* VAPtr = FindVA(VD->getType().getTypePtr())) {
         setVAPtr(VAPtr);
@@ -77,6 +73,11 @@
       if (ECD->getInitExpr())
         return;  
   }
+  
+  if (!decl) {
+    RawVAPtr = 0;
+    return;
+  }
 }
 
 StmtIteratorBase::StmtIteratorBase(ScopedDecl* d)