macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

tweens::linear is unsound

Open MaxVerevkin opened this issue 1 month ago • 0 comments

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.

MaxVerevkin avatar May 12 '24 16:05 MaxVerevkin