From b363b3dcd72e9caee55f4daafd47f9385984e20a Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sat, 10 Oct 2020 00:45:24 +0900 Subject: [PATCH] Fix UB in destroy_array test --- crossbeam-epoch/src/collector.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crossbeam-epoch/src/collector.rs b/crossbeam-epoch/src/collector.rs index 4c243ac76..8224e1184 100644 --- a/crossbeam-epoch/src/collector.rs +++ b/crossbeam-epoch/src/collector.rs @@ -383,7 +383,7 @@ mod tests { let ptr = v.as_mut_ptr() as usize; let len = v.len(); guard.defer_unchecked(move || { - drop(Vec::from_raw_parts(ptr as *const u8 as *mut u8, len, len)); + drop(Vec::from_raw_parts(ptr as *const i32 as *mut i32, len, len)); DESTROYS.fetch_add(len, Ordering::Relaxed); }); guard.flush();