Implement black_box
using intrinsic
The new implementation allows some `memcpy`s to be optimized away, so the uninit value in ui/sanitize/memory.rs is constructed directly onto the return place. Therefore the sanitizer now says that the value is allocated by `main` rather than `random`.
This commit is contained in:
parent
ae90dcf020
commit
1fb1643129
9 changed files with 52 additions and 15 deletions
|
@ -465,7 +465,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
);
|
||||
self.copy_op(&self.operand_index(&args[0], index)?, dest)?;
|
||||
}
|
||||
sym::likely | sym::unlikely => {
|
||||
sym::likely | sym::unlikely | sym::black_box => {
|
||||
// These just return their argument
|
||||
self.copy_op(&args[0], dest)?;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue