File tree 1 file changed +7
-6
lines changed
src/tools/bsan/bsan-rt/src 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -257,16 +257,17 @@ extern "C" fn bsan_shadow_clear(addr: usize, access_size: usize) {}
257
257
/// Loads the provenance of a given address from shadow memory and stores
258
258
/// the result in the return pointer.
259
259
#[ no_mangle]
260
- extern "C" fn bsan_load_prov ( prov : * mut MaybeUninit < Provenance > , addr : usize ) {
261
- unsafe {
262
- ( * prov) . write ( Provenance :: null ( ) ) ;
263
- }
260
+ unsafe extern "C" fn bsan_load_prov ( prov : * mut Provenance , address : usize ) {
261
+ let result = global_ctx ( ) . shadow_heap ( ) . load_prov ( address) ;
262
+ * prov = result;
264
263
}
265
264
266
265
/// Stores the given provenance value into shadow memory at the location for the given address.
267
266
#[ no_mangle]
268
- extern "C" fn bsan_store_prov ( prov : * const Provenance , addr : usize ) { }
269
-
267
+ unsafe extern "C" fn bsan_store_prov ( provenance : * const Provenance , address : usize ) {
268
+ let heap = & ( * global_ctx ( ) ) . shadow_heap ( ) ;
269
+ heap. store_prov ( provenance, address) ;
270
+ }
270
271
/// Pushes a shadow stack frame
271
272
#[ no_mangle]
272
273
extern "C" fn bsan_push_frame ( span : Span ) { }
You can’t perform that action at this time.
0 commit comments