HWASan support
This commit is contained in:
parent
0b7a598e12
commit
c7d9bffe76
18 changed files with 100 additions and 12 deletions
|
|
@ -4,7 +4,7 @@ error: invalid argument for `no_sanitize`
|
|||
LL | #[no_sanitize(brontosaurus)]
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: expected one of: `address`, `memory` or `thread`
|
||||
= note: expected one of: `address`, `hwaddress`, `memory` or `thread`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
19
src/test/ui/sanitize/hwaddress.rs
Normal file
19
src/test/ui/sanitize/hwaddress.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// needs-sanitizer-support
|
||||
// needs-sanitizer-hwaddress
|
||||
//
|
||||
// compile-flags: -Z sanitizer=hwaddress -O -g
|
||||
//
|
||||
// run-fail
|
||||
// error-pattern: HWAddressSanitizer: tag-mismatch
|
||||
|
||||
#![feature(test)]
|
||||
|
||||
use std::hint::black_box;
|
||||
|
||||
fn main() {
|
||||
let xs = vec![0, 1, 2, 3];
|
||||
// Avoid optimizing everything out.
|
||||
let xs = black_box(xs.as_ptr());
|
||||
let code = unsafe { *xs.offset(4) };
|
||||
std::process::exit(code);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue