Page MenuHomePhabricator

[analyzer] NonnullGlobalConstants: Don't be confused with a _Nonnull attribute.
ClosedPublic

Authored by NoQ on Jun 28 2019, 2:12 PM.

Details

Summary

The NonnullGlobalConstants checker models the rule "it doesn't make sense to make a constant global pointer and initialize it to null"; it makes sure that whatever it's initialized with is known to be non-null.

Ironically, annotating the type of the pointer as _Nonnull breaks the checker.

Fix handling of the _Nonnull annotation so that it was instead one more reason to believe that the value is non-null.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ created this revision.Jun 28 2019, 2:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2019, 2:12 PM
This revision is now accepted and ready to land.Jun 28 2019, 10:26 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2019, 4:03 PM