facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.98k stars 2.02k forks source link

how to custom checkers for iOS #1113

Open guoxiaomind opened 5 years ago

guoxiaomind commented 5 years ago

Hi, I use infer in my Objective-C project, The result is not accuracy,for example,I use method check nonull : ` 13. if (XMUtils.validateString(A)) {

  1.         [components addObject:A];
  2. }` , But result show NULL_DEREFERENCE ,I want to custom checkers for filter this problems, how to do I will ?fbinfer.com is not detailing, I dont find more detailed information。
jvillard commented 5 years ago

Does validateString(A) ensure that A is not nil? Infer will not always be able to conclude that accesses are safe. At the moment there is no way to suppress individual warnings but you can help infer by adding assert (A!=nil). Can you share the code of validateString()?