summaryrefslogtreecommitdiffstats
path: root/test/CodeGenObjC/arc-ternary-op.m
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2017-04-14 00:32:43 +0000
committerKuba Mracek <mracek@apple.com>2017-04-14 00:32:43 +0000
commit419bd7aef0a108954c667b94bffb277651565222 (patch)
treeff05dec8dec5be63c3d9e4ad5d0e588738f81e21 /test/CodeGenObjC/arc-ternary-op.m
parent3915a28878389759607b4562eba548dedf216298 (diff)
[ObjC] Fix lifetime markers of loop variable in EmitObjCForCollectionStmt
CodeGenFunction::EmitObjCForCollectionStmt currently emits lifetime markers for the loop variable in an inconsistent way: lifetime.start is emitted before the loop is entered, but lifetime.end is emitted inside the loop. AddressSanitizer uses these markers to track out-of-scope accesses to local variables, and we get false positives in Obj-C foreach loops (in the 2nd iteration of the loop). The markers of the loop variable need to be either both inside the loop (so that we poison and unpoison the variable in each iteration), or both outside. This patch implements the "both inside" approach. Differential Revision: https://reviews.llvm.org/D32029 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@300287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenObjC/arc-ternary-op.m')
-rw-r--r--test/CodeGenObjC/arc-ternary-op.m2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/CodeGenObjC/arc-ternary-op.m b/test/CodeGenObjC/arc-ternary-op.m
index 3488d2c538..8d2672a327 100644
--- a/test/CodeGenObjC/arc-ternary-op.m
+++ b/test/CodeGenObjC/arc-ternary-op.m
@@ -120,9 +120,9 @@ void test2(int cond) {
// CHECK-LABEL: define void @test2(
// CHECK: [[COND:%.*]] = alloca i32,
- // CHECK: alloca i8*
// CHECK: [[CLEANUP_SAVE:%.*]] = alloca i8*
// CHECK: [[RUN_CLEANUP:%.*]] = alloca i1
+ // CHECK: alloca i8*
// Evaluate condition; cleanup disabled by default.
// CHECK: [[T0:%.*]] = load i32, i32* [[COND]],
// CHECK-NEXT: icmp ne i32 [[T0]], 0