Don't call back() on an empty vector.
llvm-svn: 90678
diff --git a/clang/lib/Frontend/RewriteObjC.cpp b/clang/lib/Frontend/RewriteObjC.cpp
index fc5ec2e..08b54b2 100644
--- a/clang/lib/Frontend/RewriteObjC.cpp
+++ b/clang/lib/Frontend/RewriteObjC.cpp
@@ -4591,8 +4591,7 @@
// for (id <FooProtocol> index in someArray) ;
// This is because RewriteObjCForCollectionStmt() does textual rewriting
// and it depends on the original text locations/positions.
- Stmt *ParentStmt = Stmts.back();
- if (!ParentStmt || !isa<ObjCForCollectionStmt>(ParentStmt))
+ if (Stmts.empty() || !isa<ObjCForCollectionStmt>(Stmts.back()))
RewriteObjCQualifiedInterfaceTypes(*DS->decl_begin());
// Blocks rewrite rules.