Skip to content

Commit a3df639

Browse files
committed
fix ArithmeticOp::Stp
1 parent 015e8a9 commit a3df639

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/isa/exec.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -809,20 +809,16 @@ impl InstructionSet for ArithmeticOp {
809809
regs.get_n(reg, idx).and_then(|val| {
810810
if step.as_i8() < 0 {
811811
let mut n = Number::from(-step.as_i8());
812-
debug_assert!(
813-
n.reshape(val.layout()),
814-
"reshape target byte length is always greater"
815-
);
812+
let reshaped = n.reshape(val.layout());
813+
debug_assert!(reshaped, "reshape target byte length is always greater");
816814
val.int_sub(n, IntFlags {
817815
signed: false,
818816
wrap: false,
819817
})
820818
} else {
821819
let mut n = Number::from(*step);
822-
debug_assert!(
823-
n.reshape(val.layout()),
824-
"reshape target byte length is always greater"
825-
);
820+
let reshaped = n.reshape(val.layout());
821+
debug_assert!(reshaped, "reshape target byte length is always greater");
826822
val.int_add(n, IntFlags {
827823
signed: false,
828824
wrap: false,

0 commit comments

Comments
 (0)