aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/RewriteObjC.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-12-05 22:16:51 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-12-05 22:16:51 +0000
commitb2041de2eb3e44d04cb8c62c4369314af4fd6a90 (patch)
tree02de2abd0f65a0b22514ddf2c6d5e3714817001a /lib/Frontend/RewriteObjC.cpp
parentb85e77af052ea495aa47edcce3b1ec8887e53873 (diff)
Don't call back() on an empty vector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90678 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/RewriteObjC.cpp')
-rw-r--r--lib/Frontend/RewriteObjC.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Frontend/RewriteObjC.cpp b/lib/Frontend/RewriteObjC.cpp
index fc5ec2e9d0..08b54b2222 100644
--- a/lib/Frontend/RewriteObjC.cpp
+++ b/lib/Frontend/RewriteObjC.cpp
@@ -4591,8 +4591,7 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) {
// 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.