You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---- instruction::immediate::tests::test_overflow stdout ----
thread 'sandbox::tests::test_overflow' panicked at 'attempt to shift right with overflow', src\lib.rs:7:18
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src\panicking.rs:578
1: core::panicking::panic_fmt
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\panicking.rs:67
2: core::panicking::panic
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\panicking.rs:117
3: sandbox::tests::test_overflow::impl$1::try_from
at .\src\lib.rs:5
4: sandbox::tests::test_overflow
at .\src\lib.rs:18
5: sandbox::tests::test_overflow::closure$0
at .\src\instruction\immediate.rs:5
6: core::ops::function::FnOnce::call_once<sandbox::tests::test_overflow::closure_env$0,tuple$<> >
at /rustc/90c541806f23a127002de5b4038be731ba1458ca\library\core\src\ops\function.rs:250
7: core::ops::function::FnOnce::call_once
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
The text was updated successfully, but these errors were encountered:
Hi there, thank you for the bug report.
Would you want to pick this up? I can guide you a bit if you want to.
The error is in our try_from_bits generation code, where I just used the wrong shift operator (>> instead of wrapping_shr).
Triggering this panic also seems to require the struct and enum width to match the width of the underlying integer representation.
Here's the most minimal reproduction I could create of the issue, I can also reproduce this with 16, 32, and 64 bits:
The text was updated successfully, but these errors were encountered: