diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-02-07 17:00:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-02-07 17:00:16 +0100 |
| commit | 2f1eaeea772c2800cd45d263a6927db366f5bdc5 (patch) | |
| tree | 1f9f6d8e4553a4a0cee6a539eb2767bcf9259d09 /src/librustc | |
| parent | b5e21dbb5cabdaaadc47a4d8e3f59979dcad2871 (diff) | |
| parent | 80adde2e337f4e0d784da401b2db37c5d4d3468b (diff) | |
| download | rust-2f1eaeea772c2800cd45d263a6927db366f5bdc5.tar.gz rust-2f1eaeea772c2800cd45d263a6927db366f5bdc5.zip | |
Rollup merge of #68164 - tmiasko:no-sanitize, r=nikomatsakis
Selectively disable sanitizer instrumentation Add `no_sanitize` attribute that allows to opt out from sanitizer instrumentation in an annotated function.
Diffstat (limited to 'src/librustc')
| -rw-r--r-- | src/librustc/middle/codegen_fn_attrs.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustc/middle/codegen_fn_attrs.rs b/src/librustc/middle/codegen_fn_attrs.rs index 9f8c2020861..82adcfddc28 100644 --- a/src/librustc/middle/codegen_fn_attrs.rs +++ b/src/librustc/middle/codegen_fn_attrs.rs @@ -72,6 +72,14 @@ bitflags! { const FFI_RETURNS_TWICE = 1 << 10; /// `#[track_caller]`: allow access to the caller location const TRACK_CALLER = 1 << 11; + /// `#[no_sanitize(address)]`: disables address sanitizer instrumentation + const NO_SANITIZE_ADDRESS = 1 << 12; + /// `#[no_sanitize(memory)]`: disables memory sanitizer instrumentation + const NO_SANITIZE_MEMORY = 1 << 13; + /// `#[no_sanitize(thread)]`: disables thread sanitizer instrumentation + const NO_SANITIZE_THREAD = 1 << 14; + /// All `#[no_sanitize(...)]` attributes. + const NO_SANITIZE_ANY = Self::NO_SANITIZE_ADDRESS.bits | Self::NO_SANITIZE_MEMORY.bits | Self::NO_SANITIZE_THREAD.bits; } } |
