This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] Move the errno/ENOMEM allocator checks logic to separate .cc
ClosedPublic

Authored by cryptoad on Oct 9 2017, 2:54 PM.

Details

Summary

The fact that sanitizer_allocator_checks.h is including sanitizer_errno.h
creates complications for future changes, where it would conflict with errno.h
definitions on Android and Fuchsia (macro redefinition).

By moving the portion that sets errno in the checks to a separate compilation
unit, we avoid the inclusion of the header there, which solves the issue.

Not that it is not vital to have that function in a header as it is called as a
result of an unlikely event, and doesn't need to be inlined.

Event Timeline

cryptoad created this revision.Oct 9 2017, 2:54 PM
alekseyshl accepted this revision.Oct 9 2017, 4:23 PM
alekseyshl added inline comments.
lib/sanitizer_common/sanitizer_allocator_checks.cc
11

Fix this comment (I guess, copying your comment from the header file is enough).

This revision is now accepted and ready to land.Oct 9 2017, 4:23 PM
cryptoad updated this revision to Diff 118394.EditedOct 10 2017, 7:55 AM

Updating .cc file comment.

cryptoad marked an inline comment as done.Oct 10 2017, 7:56 AM
cryptoad closed this revision.Oct 10 2017, 7:58 AM