Skip to content

Commit 5ea6e70

Browse files
bors[bot]taiki-e
andauthored
Merge #580
580: Fix UB in destroy_array test r=jeehoonkang a=taiki-e Reportrd by Miri in #578 ([log](https://github.com/crossbeam-rs/crossbeam/runs/1232029543?check_suite_focus=true)) https://github.com/crossbeam-rs/crossbeam/blob/e08b21cc086fc42af0e9927a68bc3120bee87af5/crossbeam-epoch/src/collector.rs#L378-L388 `ptr` is a pointer to `Vec<i32>`, but deallocated as `Vec<u8>`. Co-authored-by: Taiki Endo <te316e89@gmail.com>
2 parents e08b21c + b363b3d commit 5ea6e70

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crossbeam-epoch/src/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ mod tests {
383383
let ptr = v.as_mut_ptr() as usize;
384384
let len = v.len();
385385
guard.defer_unchecked(move || {
386-
drop(Vec::from_raw_parts(ptr as *const u8 as *mut u8, len, len));
386+
drop(Vec::from_raw_parts(ptr as *const i32 as *mut i32, len, len));
387387
DESTROYS.fetch_add(len, Ordering::Relaxed);
388388
});
389389
guard.flush();

0 commit comments

Comments
 (0)