@@ -24,7 +24,7 @@ pub fn process_code(
24
24
for chunk in data. chunks_exact ( 4 ) {
25
25
let reloc = relocs. iter ( ) . find ( |r| ( r. address as u32 & !3 ) == cur_addr) ;
26
26
let code = u32:: from_be_bytes ( chunk. try_into ( ) ?) ;
27
- let mut instruction = Instruction :: new ( code, cur_addr, InstrCategory :: CPU ) ;
27
+ let instruction = Instruction :: new ( code, cur_addr, InstrCategory :: CPU ) ;
28
28
29
29
let op = instruction. unique_id as u8 ;
30
30
ops. push ( op) ;
@@ -38,7 +38,7 @@ pub fn process_code(
38
38
. get_operands_slice ( )
39
39
. iter ( )
40
40
. map ( |op| match op {
41
- OperandType :: cpu_immediate | OperandType :: cpu_label => {
41
+ OperandType :: cpu_immediate | OperandType :: cpu_label | OperandType :: cpu_branch_target_label => {
42
42
if is_branch {
43
43
ObjInsArg :: BranchOffset ( branch_offset)
44
44
} else if let Some ( reloc) = reloc {
@@ -52,17 +52,17 @@ pub fn process_code(
52
52
ObjInsArg :: Reloc
53
53
}
54
54
} else {
55
- ObjInsArg :: MipsArg ( op. disassemble ( instruction, None ) )
55
+ ObjInsArg :: MipsArg ( op. disassemble ( & instruction, None ) )
56
56
}
57
57
}
58
58
OperandType :: cpu_immediate_base => {
59
59
if reloc. is_some ( ) {
60
60
ObjInsArg :: RelocWithBase
61
61
} else {
62
- ObjInsArg :: MipsArg ( op. disassemble ( instruction, None ) )
62
+ ObjInsArg :: MipsArg ( op. disassemble ( & instruction, None ) )
63
63
}
64
64
}
65
- _ => ObjInsArg :: MipsArg ( op. disassemble ( instruction, None ) ) ,
65
+ _ => ObjInsArg :: MipsArg ( op. disassemble ( & instruction, None ) ) ,
66
66
} )
67
67
. collect ( ) ;
68
68
insts. push ( ObjIns {
0 commit comments