@@ -9,7 +9,7 @@ use iced_x86::{
99use object:: { Endian as _, Object as _, ObjectSection as _, elf, pe} ;
1010
1111use crate :: {
12- arch:: { Arch , OPCODE_INVALID , RelocationOverride , RelocationOverrideTarget } ,
12+ arch:: { Arch , OPCODE_DATA , RelocationOverride , RelocationOverrideTarget } ,
1313 diff:: { DiffObjConfig , X86Formatter , display:: InstructionPart } ,
1414 obj:: { InstructionRef , Relocation , RelocationFlags , ResolvedInstructionRef , Section , Symbol } ,
1515} ;
@@ -119,7 +119,7 @@ impl Arch for ArchX86 {
119119 out. push ( InstructionRef {
120120 address,
121121 size : size as u8 ,
122- opcode : OPCODE_INVALID ,
122+ opcode : OPCODE_DATA ,
123123 branch_dest : None ,
124124 } ) ;
125125
@@ -146,7 +146,7 @@ impl Arch for ArchX86 {
146146 out. push ( InstructionRef {
147147 address : indirect_array_address + i as u64 ,
148148 size : 1 ,
149- opcode : OPCODE_INVALID ,
149+ opcode : OPCODE_DATA ,
150150 branch_dest : None ,
151151 } ) ;
152152 }
@@ -185,14 +185,14 @@ impl Arch for ArchX86 {
185185 diff_config : & DiffObjConfig ,
186186 cb : & mut dyn FnMut ( InstructionPart ) -> Result < ( ) > ,
187187 ) -> Result < ( ) > {
188- if resolved. ins_ref . opcode == OPCODE_INVALID {
188+ if resolved. ins_ref . opcode == OPCODE_DATA {
189189 let ( mnemonic, imm) = match resolved. ins_ref . size {
190190 1 => ( ".byte" , resolved. code [ 0 ] as u64 ) ,
191191 2 => ( ".word" , self . endianness . read_u16_bytes ( resolved. code . try_into ( ) ?) as u64 ) ,
192192 4 => ( ".dword" , self . endianness . read_u32_bytes ( resolved. code . try_into ( ) ?) as u64 ) ,
193193 _ => bail ! ( "Unsupported x86 inline data size {}" , resolved. ins_ref. size) ,
194194 } ;
195- cb ( InstructionPart :: opcode ( mnemonic, OPCODE_INVALID ) ) ?;
195+ cb ( InstructionPart :: opcode ( mnemonic, OPCODE_DATA ) ) ?;
196196 if resolved. relocation . is_some ( ) {
197197 cb ( InstructionPart :: reloc ( ) ) ?;
198198 } else {
@@ -834,7 +834,7 @@ mod test {
834834 ins_ref : InstructionRef {
835835 address : 0x1234 ,
836836 size : 1 ,
837- opcode : OPCODE_INVALID ,
837+ opcode : OPCODE_DATA ,
838838 branch_dest : None ,
839839 } ,
840840 code : & code,
@@ -848,7 +848,7 @@ mod test {
848848 )
849849 . unwrap ( ) ;
850850 assert_eq ! ( parts, & [
851- InstructionPart :: opcode( ".byte" , OPCODE_INVALID ) ,
851+ InstructionPart :: opcode( ".byte" , OPCODE_DATA ) ,
852852 InstructionPart :: unsigned( 0xABu64 ) ,
853853 ] ) ;
854854 }
0 commit comments