diff options
author | Richard Trieu <rtrieu@google.com> | 2018-05-29 22:43:00 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2018-05-29 22:43:00 +0000 |
commit | 67a7d387469b0866a25b704f53a8ef8a12ddfd18 (patch) | |
tree | 05c59db68ad1967184a59596169659575e8db2af /test/SemaObjC | |
parent | 77a37b6cca10146d8205cc55b281762057dfdd5a (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.mm | 3 |
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 = @""; |