Summary:
This diff adds translation of `arrayWithObjects:count:`. In the previous implementation it was
translated as if it was `arrayWithObjects:`, but their function parameters are different.
In this diff, it translates an array literal `NSArray* a = @ [ 2, 3 ];` to
```
n$1=NSNumber.numberWithInt:(2:int)
n$2=NSNumber.numberWithInt:(3:int)
temp[0]:objc_object*=n$1
temp[1]:objc_object*=n$2
n$3=NSArray.arrayWithObjects:count:(temp:objc_object* const [2*8],2:int)
a:NSArray*=n$3
```
where `temp` is an additional local variable declared as array.
See,
https://developer.apple.com/documentation/foundation/nsarray/1460145-arraywithobjectshttps://developer.apple.com/documentation/foundation/nsarray/1460096-arraywithobjects?language=objc
Reviewed By: jvillard
Differential Revision: D22631305
fbshipit-source-id: 5be0a55d4
master
Sungkeun Cho4 years agocommitted byFacebook GitHub Bot
codetoanalyze/objc/biabduction/npe/UpdateDict.m, update_array_with_null, 5, NULL_DEREFERENCE, B1, ERROR, [start of procedure update_array_with_null()]
codetoanalyze/objc/biabduction/npe/UpdateDict.m, update_dict_with_key_null, 10, NULL_DEREFERENCE, B1, ERROR, [start of procedure update_dict_with_key_null(),Skipping dictionaryWithObjectsAndKeys:: method has no implementation]
codetoanalyze/objc/biabduction/npe/nil_in_array_literal.m, Arr.insertNilBad, 3, NULL_DEREFERENCE, B1, ERROR, [start of procedure insertNilBad,start of procedure initA,Taking true branch,return from a call to A.initA]
codetoanalyze/objc/biabduction/npe/nil_in_array_literal.m, Arr.nilInArrayLiteral0, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure nilInArrayLiteral0]
codetoanalyze/objc/biabduction/npe/nil_in_array_literal.m, Arr.nilInArrayLiteral1, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure nilInArrayLiteral1]
codetoanalyze/objc/biabduction/npe/nil_in_array_literal.m, Arr.nilInArrayLiteral2, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure nilInArrayLiteral2]
codetoanalyze/objc/biabduction/npe/nil_in_array_literal.m, Arr.nilInArrayLiteral3, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure nilInArrayLiteral3]
codetoanalyze/objc/biabduction/npe/nil_in_array_literal.m, Arr.nilInArrayWithObject, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure nilInArrayWithObject]
codetoanalyze/objc/biabduction/npe/nil_in_dictionary_literal.m, ADict.nilInDictionaryLiteralKey0, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure nilInDictionaryLiteralKey0]
codetoanalyze/objc/biabduction/npe/nil_in_dictionary_literal.m, ADict.nilInDictionaryLiteralKey1, 4, NULL_DEREFERENCE, B1, ERROR, [start of procedure nilInDictionaryLiteralKey1]