aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2018-05-29 22:43:00 +0000
committerRichard Trieu <rtrieu@google.com>2018-05-29 22:43:00 +0000
commit67a7d387469b0866a25b704f53a8ef8a12ddfd18 (patch)
tree05c59db68ad1967184a59596169659575e8db2af /test/SemaObjC
parent77a37b6cca10146d8205cc55b281762057dfdd5a (diff)
Check pointer null-ness before dereferencing it.
-Warc-repeated-use-of-weak may trigger a segmentation fault when the Decl being checked is outside of a function scope, leaving the current function info pointer null. This adds a check before using the function info. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@333471 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjC')
-rw-r--r--test/SemaObjC/arc-repeated-weak.mm3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/SemaObjC/arc-repeated-weak.mm b/test/SemaObjC/arc-repeated-weak.mm
index 37b2123ec1..d153eb9a52 100644
--- a/test/SemaObjC/arc-repeated-weak.mm
+++ b/test/SemaObjC/arc-repeated-weak.mm
@@ -479,3 +479,6 @@ void foo1() {
// expected-error@-2{{cast of 'E' to 'INTFPtrTy' (aka 'INTF *') is disallowed with ARC}}
#endif
}
+
+@class NSString;
+static NSString* const kGlobal = @"";