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 | e69acc5d8fd373686f1cb6635d600d160872d43d (patch) | |
| tree | 4d7ef71f846418d13178ed793856affe23725b8d /clang/test/SemaObjC | |
| parent | dd38d931987aceeabe51ed459f4a27aeec82df14 (diff) | |
| download | bcm5719-llvm-e69acc5d8fd373686f1cb6635d600d160872d43d.tar.gz bcm5719-llvm-e69acc5d8fd373686f1cb6635d600d160872d43d.zip | |
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.
llvm-svn: 333471
Diffstat (limited to 'clang/test/SemaObjC')
| -rw-r--r-- | clang/test/SemaObjC/arc-repeated-weak.mm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/arc-repeated-weak.mm b/clang/test/SemaObjC/arc-repeated-weak.mm index 37b2123ec1c..d153eb9a52e 100644 --- a/clang/test/SemaObjC/arc-repeated-weak.mm +++ b/clang/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 = @""; |

