cargo miri test
fails with Undefined Behavior: trying to retag ...
#455
Labels
invalid
This doesn't seem right
Handlers are created with many different types, which share the same first field as the OpCodeHandler struct. They're cast to a
*const
pointer to this struct despite not being of that type, and stored in a map.iced/src/rust/iced-x86/src/decoder/handlers.rs
Lines 109 to 112 in 9345589
Later during decoding the handler is cast back to its original type, and
cargo miri test
fails here with a stacked borrows Undefined Behavior error:iced/src/rust/iced-x86/src/decoder/handlers/legacy.rs
Lines 2583 to 2584 in 9345589
Related snippets:
iced/src/rust/iced-x86/src/decoder/handlers.rs
Lines 58 to 61 in 9345589
iced/src/rust/iced-x86/src/decoder/handlers.rs
Lines 75 to 78 in 9345589
Running
cargo miri test
in src/rust produces:The text was updated successfully, but these errors were encountered: