File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
cross-checks/rust-checks/runtime/src Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -214,17 +214,19 @@ fn try_pointer<'a, T: ?Sized>(p: *const T) -> Option<&'a T> {
214214 let mut invalid: u8 = 0 ;
215215 unsafe {
216216 // Same implementation as clang-plugin/runtime/hash.c
217- asm ! ( " jmp 1f
218- .word 2f - 1f
219- .ascii \" C2RUST_INVPTR\\ 0\"
220- 1: movb ($2), $0
221- jmp 3f
222- 2: incb $1
223- 3:"
224- : "=r" ( _pv) , "+r" ( invalid)
225- : "r" ( p)
226- : "cc"
227- : "volatile" ) ;
217+ core:: arch:: asm!(
218+ "jmp 1f" ,
219+ ".word 2f - 1f" ,
220+ ".ascii \" C2RUST_INVPTR\\ 0\" " ,
221+ "1: movb ({0}), {1}" ,
222+ "jmp 3f" ,
223+ "2: incb {2}" ,
224+ "3:" ,
225+ in( reg) p. cast:: <u8 >( ) ,
226+ out( reg_byte) _pv,
227+ inout( reg_byte) invalid,
228+ options( att_syntax) ,
229+ ) ;
228230 if invalid == 0 {
229231 Some ( & * p)
230232 } else {
Original file line number Diff line number Diff line change 11#![ feature( never_type) ]
2- #![ feature( asm) ]
32#![ cfg_attr( feature = "xcheck-with-dlsym" , feature( const_fn) ) ]
43#![ cfg_attr( feature = "xcheck-with-dlsym" , feature( const_ptr_null_mut) ) ]
54#![ cfg_attr( feature = "xcheck-with-dlsym" , feature( libc) ) ]
You can’t perform that action at this time.
0 commit comments