Commit Graph

5 Commits

Author SHA1 Message Date
George Karpenkov 03242ea571 [analyzer] [quickfix] Temporarily disabling a failing test.
llvm-svn: 343747
2018-10-04 00:07:45 +00:00
George Karpenkov 0550dac3ed [analyzer] Do not crash if the assumption added in TrustNonNullChecker is enough to make the state unfeasible
rdar://43541814

Differential Revision: https://reviews.llvm.org/D52848

llvm-svn: 343735
2018-10-03 22:31:09 +00:00
George Karpenkov e99ba6e1f9 [analyzer] Record nullability implications on getting items from NSDictionary
If we get an item from a dictionary, we know that the item is non-null
if and only if the key is non-null.

This patch is a rather hacky way to record this implication, because
some logic needs to be duplicated from the solver.
And yet, it's pretty simple, performant, and works.

Other possible approaches:

 - Record the implication, in future rely on Z3 to pick it up.
 - Generalize the current code and move it to the constraint manager.

rdar://34990742

Differential Revision: https://reviews.llvm.org/D50124

llvm-svn: 339482
2018-08-10 22:27:04 +00:00
George Karpenkov 7744c7f137 [analyzer] Trust _Nonnull annotations, and trust analyzer knowledge about receiver nullability
Previously, the checker was using the nullability of the expression,
which is nonnull IFF both receiver and method are annotated as _Nonnull.
However, the receiver could be known to the analyzer to be nonnull
without being explicitly marked as _Nonnull.

rdar://40635584

Differential Revision: https://reviews.llvm.org/D47510

llvm-svn: 333612
2018-05-31 00:28:13 +00:00
George Karpenkov 2301c5ab4d [analyzer] Trust _Nonnull annotations for system framework
Changes the analyzer to believe that methods annotated with _Nonnull
from system frameworks indeed return non null objects.
Local methods with such annotation are still distrusted.
rdar://24291919

Differential Revision: https://reviews.llvm.org/D44341

llvm-svn: 328282
2018-03-23 00:16:03 +00:00