This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Handle another Android assert function.
ClosedPublic

Authored by ygribov on Dec 29 2015, 7:51 AM.

Details

Summary

Android's assert can call both assert and assert2 functions under the cover but NoReturn does not handle the latter. This patch fixes this.

Diff Detail

Repository
rL LLVM

Event Timeline

ygribov updated this revision to Diff 43737.Dec 29 2015, 7:51 AM
ygribov retitled this revision from to [analyzer] Handle another Android assert function..
ygribov updated this object.
ygribov added reviewers: zaks.anna, dcoughlin.
ygribov set the repository for this revision to rL LLVM.
ygribov added a subscriber: llvm-commits.
ygribov added a comment.EditedDec 29 2015, 7:52 AM

Relevant snippet from bionic/libc/include/assert.h:

# if __ISO_C_VISIBLE >= 1999
#  define       assert(e)       ((e) ? (void)0 : __assert2(__FILE__, __LINE__, __func__, #e))
...
__dead void __assert2(const char *, int, const char *, const char *);
dcoughlin edited edge metadata.Dec 29 2015, 9:57 AM

Thanks Yuri! This looks great. Can you also add a test to tests/analysis/NoReturn.m for this? You can follow the example of test_wassert there.

ygribov updated this revision to Diff 43742.Dec 29 2015, 10:01 AM
ygribov edited edge metadata.

Added a test.

This revision was automatically updated to reflect the committed changes.