mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-23 02:27:39 +03:00
rustrt: Fix invalid reads caught by valgrind
This is another case of #13246. The RAII lock wasn't being destroyed until after the allocation was free'd due to destructor scheduling. Closes #14784
This commit is contained in:
@@ -54,7 +54,8 @@ pub fn run() {
|
||||
rtassert!(queue != 0);
|
||||
|
||||
let queue: Box<Queue> = mem::transmute(queue);
|
||||
mem::replace(&mut *queue.lock(), Vec::new())
|
||||
let v = mem::replace(&mut *queue.lock(), Vec::new());
|
||||
v
|
||||
};
|
||||
|
||||
for to_run in cur.move_iter() {
|
||||
|
||||
Reference in New Issue
Block a user