Skip to content

Commit fb2727b

Browse files
committed
Update rabbitizer to v2.0.0-alpha.4
1 parent bd3ed0d commit fb2727b

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

Cargo.lock

Lines changed: 13 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

objdiff-core/src/arch/mips.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ use alloc::{
77
use anyhow::{Result, bail};
88
use object::{Endian as _, Object as _, ObjectSection as _, ObjectSymbol as _, elf};
99
use rabbitizer::{
10-
IsaExtension, IsaVersion, Vram,
11-
abi::Abi,
12-
operands::{IU16, ValuedOperand},
13-
registers_meta::Register,
10+
IsaExtension, IsaVersion, Vram, abi::Abi, operands::ValuedOperand, registers_meta::Register,
1411
};
1512

1613
use crate::{
@@ -335,14 +332,18 @@ fn push_args(
335332
}
336333

337334
match op {
338-
ValuedOperand::core_immediate(imm) => {
335+
ValuedOperand::core_imm_i16(imm) => {
339336
if let Some(resolved) = relocation {
340337
push_reloc(resolved.relocation, &mut arg_cb)?;
341338
} else {
342-
arg_cb(match imm {
343-
IU16::Integer(s) => InstructionPart::signed(s),
344-
IU16::Unsigned(u) => InstructionPart::unsigned(u),
345-
})?;
339+
arg_cb(InstructionPart::signed(imm))?;
340+
}
341+
}
342+
ValuedOperand::core_imm_u16(imm) => {
343+
if let Some(resolved) = relocation {
344+
push_reloc(resolved.relocation, &mut arg_cb)?;
345+
} else {
346+
arg_cb(InstructionPart::unsigned(imm))?;
346347
}
347348
}
348349
ValuedOperand::core_label(..) | ValuedOperand::core_branch_target_label(..) => {
@@ -359,14 +360,13 @@ fn push_args(
359360
))?;
360361
}
361362
}
362-
ValuedOperand::core_immediate_base(imm, base) => {
363+
ValuedOperand::core_imm_rs(imm, base) => {
363364
if let Some(resolved) = relocation {
364365
push_reloc(resolved.relocation, &mut arg_cb)?;
365366
} else {
366-
arg_cb(InstructionPart::Arg(InstructionArg::Value(match imm {
367-
IU16::Integer(s) => InstructionArgValue::Signed(s as i64),
368-
IU16::Unsigned(u) => InstructionArgValue::Unsigned(u as u64),
369-
})))?;
367+
arg_cb(InstructionPart::Arg(InstructionArg::Value(
368+
InstructionArgValue::Signed(imm as i64),
369+
)))?;
370370
}
371371
arg_cb(InstructionPart::basic("("))?;
372372
arg_cb(InstructionPart::opaque(base.either_name(

0 commit comments

Comments
 (0)