diff options
author | George Burgess IV <gbiv@google.com> | 2019-05-09 14:32:43 -0700 |
---|---|---|
committer | George Burgess IV <gbiv@google.com> | 2019-05-23 13:39:04 -0700 |
commit | 5da5dd5215b1dc2e12e0908a1c74fe0b7672835d (patch) | |
tree | 2ae61ffd9c9baf2d89c28bcc544e13a83394e07c /libc/malloc_debug/malloc_debug.cpp | |
parent | ff7179350a1023bdef62ee34ae061804f5fc0353 (diff) |
fortify: Migrate trivial cases to dynamic check macros
|__builtin_constant_p| has become more flexible in clang. In particular,
it's no longer forcibly lowered before inlining, so we can actually use
it on function parameters (or |__bos(param)|).
This CL tweaks things so that trivially safe calls to FORTIFY'ed
functions compile into direct calls to those functions, rather than to
their _chk counterparts. This will be the most impactful with things
like |memset|, |memcpy|, etc., since clang has way more flexibility
about how to lower those than it does with |__memset_chk|,
|__memcpy_chk|, ...
As noted in the comments, the spelling of the new macros is meant to
match closely with the spelling of our |__bos_static| macros used in
|diagnose_if|.
This isn't a full cleanup of all of the cases in which we can do this.
Just a start on the super simple cases.
Bug: 131861088
Test: m checkbuild; blueline boots.
Change-Id: I696f42ce4a65231e0c4a78a4c5133a6be1cb7708
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
0 files changed, 0 insertions, 0 deletions