macroquad
macroquad copied to clipboard
tweens::linear is unsound
The following code segfaults:
struct Node {
b: Box<u8>,
c: Box<u8>,
}
impl scene::Node for Node {}
let node = scene::add_node(Node {
b: Box::new(0),
c: Box::new(0),
});
tweens::linear(
node,
|node| {
dbg!(&node.b);
dbg!(&node.c);
todo!()
},
0.0,
1.0,
1.0,
);
The lens
callback receives a mutable reference pointing to uninitialized memory, which is immediate UB.