This is an archive of the discontinued LLVM Phabricator instance.

Fix nullability checking of top-level functions
Needs ReviewPublic

Authored by chrisbazley on Jan 27 2023, 8:57 AM.

Details

Reviewers
NoQ
Summary

The existing nullability checker is so limited
when applied to top-level functions that a casual
observer might assume it doesn't work at all:

void test1(int *_Nullable x)
{

*x = 5; // no warning!

}

Added a NullabilityChecker::checkBeginFunction method
to honour any _Nullable annotation of parameters in
a top-level call.

Diff Detail