forked from OSchip/llvm-project
[static analyzer] Don't flag nil storage into NSMutableDictionary.
This is now allowed and has the behavior of removing the mapping. llvm-svn: 252679
This commit is contained in:
parent
2c98d0f477
commit
de14eb5b4e
|
@ -307,8 +307,7 @@ void NilArgChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
|
|||
warnIfNilArg(C, msg, /* Arg */1, Class);
|
||||
} else if (S == SetObjectForKeyedSubscriptSel) {
|
||||
CanBeSubscript = true;
|
||||
Arg = 0;
|
||||
warnIfNilArg(C, msg, /* Arg */1, Class, CanBeSubscript);
|
||||
Arg = 1;
|
||||
} else if (S == RemoveObjectForKeySel) {
|
||||
Arg = 0;
|
||||
}
|
||||
|
|
|
@ -155,13 +155,12 @@ void testNilArgNSMutableDictionary3(NSMutableDictionary *d) {
|
|||
}
|
||||
|
||||
void testNilArgNSMutableDictionary5(NSMutableDictionary *d, NSString* key) {
|
||||
d[key] = 0; // expected-warning {{Value stored into 'NSMutableDictionary' cannot be nil}}
|
||||
d[key] = 0; // no-warning - removing the mapping for the given key
|
||||
}
|
||||
void testNilArgNSMutableDictionary6(NSMutableDictionary *d, NSString *key) {
|
||||
if (key)
|
||||
;
|
||||
d[key] = 0; // expected-warning {{'NSMutableDictionary' key cannot be nil}}
|
||||
// expected-warning@-1 {{Value stored into 'NSMutableDictionary' cannot be nil}}
|
||||
}
|
||||
|
||||
NSDictionary *testNilArgNSDictionary1(NSString* key) {
|
||||
|
|
Loading…
Reference in New Issue