brintos

brintos / llvm-project-archived public Read only

0
0
Text · 801 B · 8bb0196 Raw
40 lines · plain
1// RUN: %clang_analyze_cc1 -analyzer-checker=core,apiModeling,nullability.NullableDereferenced -x objective-c %s2/*3  This test is reduced from a static analyzer crash. The bug causing4  the crash is explained in #124477.  It can only be triggered in some5  rare cases so please do not modify this reproducer.6*/7 8#pragma clang assume_nonnull begin9# 15 "some-sys-header.h" 1 310@class NSArray, NSObject;11 12@interface Base13@property (readonly, copy) NSArray *array;14@end15 16#pragma clang assume_nonnull end17# 8 "this-file.m" 218 19 20@interface Test : Base21 22@property (readwrite, copy, nullable) NSObject *label;23@property (readwrite, strong, nullable) Test * field;24 25- (void)f;26 27@end28 29@implementation Test30- (void)f31{32  NSObject * X;33 34  for (NSObject *ele in self.field.array) {}35  self.label = X;  36}37@end38 39 40