Limit type of foreach's element and collection to be a pointer to 
objc object type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45709 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/Sema.cpp b/Sema/Sema.cpp
index 8f340db..b33e782 100644
--- a/Sema/Sema.cpp
+++ b/Sema/Sema.cpp
@@ -33,7 +33,7 @@
       type->isObjcQualifiedIdType())
     return true;
   
-  while (type->isPointerType()) {
+  if (type->isPointerType()) {
     PointerType *pointerType = static_cast<PointerType*>(type.getTypePtr());
     type = pointerType->getPointeeType();
   }