Skip to content

Commit

Permalink
isa: fix BytesOp::Put
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Nov 16, 2023
1 parent 586657c commit afdc103
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/isa/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ impl InstructionSet for BytesOp {
match self {
BytesOp::Put(reg, bytes, st0) => {
regs.s16[reg.as_usize()] = Some(*bytes.clone());
if *st0 {
if !*st0 {
regs.st0 = false
}
}
Expand Down Expand Up @@ -1175,12 +1175,12 @@ mod tests {
let lib_site = LibSite::default();
let s1 = "apple_banana_kiwi".as_bytes();
let s2 = "apple@banana@kiwi".as_bytes();
BytesOp::Put(1.into(), Box::new(ByteStr::with(s1)), false).exec(
BytesOp::Put(1.into(), Box::new(ByteStr::with(s1)), true).exec(
&mut register,
lib_site,
&(),
);
BytesOp::Put(2.into(), Box::new(ByteStr::with(s2)), false).exec(
BytesOp::Put(2.into(), Box::new(ByteStr::with(s2)), true).exec(
&mut register,
lib_site,
&(),
Expand Down Expand Up @@ -1271,12 +1271,12 @@ mod tests {

let s1 = [0u8; u16::MAX as usize];
let s2 = [0u8; u16::MAX as usize];
BytesOp::Put(1.into(), Box::new(ByteStr::with(s1)), false).exec(
BytesOp::Put(1.into(), Box::new(ByteStr::with(s1)), true).exec(
&mut register,
lib_site,
&(),
);
BytesOp::Put(2.into(), Box::new(ByteStr::with(s2)), false).exec(
BytesOp::Put(2.into(), Box::new(ByteStr::with(s2)), true).exec(
&mut register,
lib_site,
&(),
Expand Down

0 comments on commit afdc103

Please sign in to comment.