Skip to content

Commit

Permalink
Correctly disassemble locals as i32.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivorforce committed Jul 16, 2024
1 parent f298acf commit a7e1739
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interpreter/disassembler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ pub fn disassemble_one(ip: *const u8) -> usize {
print!("\t{:?}", read_unaligned(ip.add(1) as *mut u16));
return 1 + 2;
}
OpCode::LOAD32 | OpCode::LOAD_LOCAL_32 | OpCode::STORE_LOCAL_32 | OpCode::LOAD_CONSTANT_32 => {
OpCode::LOAD32 | OpCode::LOAD_CONSTANT_32 => {
print!("\t{:?}", read_unaligned(ip.add(1) as *mut u32));
return 1 + 4;
}
OpCode::LOAD64 => {
print!("\t{:?}", read_unaligned(ip.add(1) as *mut u64));
return 1 + 8;
}
OpCode::JUMP | OpCode::JUMP_IF_FALSE => {
OpCode::JUMP | OpCode::JUMP_IF_FALSE | OpCode::LOAD_LOCAL_32 | OpCode::STORE_LOCAL_32 => {
print!("\t{:?}", read_unaligned(ip.add(1) as *mut i32));
return 1 + 4;
}
Expand Down

0 comments on commit a7e1739

Please sign in to comment.