@@ -9,7 +9,7 @@ use iced_x86::{
9
9
use object:: { Endian as _, Object as _, ObjectSection as _, elf, pe} ;
10
10
11
11
use crate :: {
12
- arch:: { Arch , OPCODE_INVALID , RelocationOverride , RelocationOverrideTarget } ,
12
+ arch:: { Arch , OPCODE_DATA , RelocationOverride , RelocationOverrideTarget } ,
13
13
diff:: { DiffObjConfig , X86Formatter , display:: InstructionPart } ,
14
14
obj:: { InstructionRef , Relocation , RelocationFlags , ResolvedInstructionRef , Section , Symbol } ,
15
15
} ;
@@ -119,7 +119,7 @@ impl Arch for ArchX86 {
119
119
out. push ( InstructionRef {
120
120
address,
121
121
size : size as u8 ,
122
- opcode : OPCODE_INVALID ,
122
+ opcode : OPCODE_DATA ,
123
123
branch_dest : None ,
124
124
} ) ;
125
125
@@ -146,7 +146,7 @@ impl Arch for ArchX86 {
146
146
out. push ( InstructionRef {
147
147
address : indirect_array_address + i as u64 ,
148
148
size : 1 ,
149
- opcode : OPCODE_INVALID ,
149
+ opcode : OPCODE_DATA ,
150
150
branch_dest : None ,
151
151
} ) ;
152
152
}
@@ -185,14 +185,14 @@ impl Arch for ArchX86 {
185
185
diff_config : & DiffObjConfig ,
186
186
cb : & mut dyn FnMut ( InstructionPart ) -> Result < ( ) > ,
187
187
) -> Result < ( ) > {
188
- if resolved. ins_ref . opcode == OPCODE_INVALID {
188
+ if resolved. ins_ref . opcode == OPCODE_DATA {
189
189
let ( mnemonic, imm) = match resolved. ins_ref . size {
190
190
1 => ( ".byte" , resolved. code [ 0 ] as u64 ) ,
191
191
2 => ( ".word" , self . endianness . read_u16_bytes ( resolved. code . try_into ( ) ?) as u64 ) ,
192
192
4 => ( ".dword" , self . endianness . read_u32_bytes ( resolved. code . try_into ( ) ?) as u64 ) ,
193
193
_ => bail ! ( "Unsupported x86 inline data size {}" , resolved. ins_ref. size) ,
194
194
} ;
195
- cb ( InstructionPart :: opcode ( mnemonic, OPCODE_INVALID ) ) ?;
195
+ cb ( InstructionPart :: opcode ( mnemonic, OPCODE_DATA ) ) ?;
196
196
if resolved. relocation . is_some ( ) {
197
197
cb ( InstructionPart :: reloc ( ) ) ?;
198
198
} else {
@@ -834,7 +834,7 @@ mod test {
834
834
ins_ref : InstructionRef {
835
835
address : 0x1234 ,
836
836
size : 1 ,
837
- opcode : OPCODE_INVALID ,
837
+ opcode : OPCODE_DATA ,
838
838
branch_dest : None ,
839
839
} ,
840
840
code : & code,
@@ -848,7 +848,7 @@ mod test {
848
848
)
849
849
. unwrap ( ) ;
850
850
assert_eq ! ( parts, & [
851
- InstructionPart :: opcode( ".byte" , OPCODE_INVALID ) ,
851
+ InstructionPart :: opcode( ".byte" , OPCODE_DATA ) ,
852
852
InstructionPart :: unsigned( 0xABu64 ) ,
853
853
] ) ;
854
854
}
0 commit comments