File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -224,12 +224,14 @@ impl Arch for ArchArm {
224224 }
225225
226226 // Check how many bytes we can/should read
227- let num_code_bytes = if mode == unarm:: ParseMode :: Data {
228- // 32-bit .word value should be aligned on a 4-byte boundary, otherwise use .hword
229- if address & 3 == 0 { 4 } else { 2 }
230- } else if data. len ( ) >= 4 {
231- // Read 4 bytes even for Thumb, as the parser will determine if it's a 2 or 4 byte instruction
232- 4
227+ let num_code_bytes = if data. len ( ) >= 4 {
228+ if mode == unarm:: ParseMode :: Data && address & 3 != 0 {
229+ // 32-bit .word value should be aligned on a 4-byte boundary, otherwise use .hword
230+ 2
231+ } else {
232+ // Read 4 bytes even for Thumb, as the parser will determine if it's a 2 or 4 byte instruction
233+ 4
234+ }
233235 } else if mode != unarm:: ParseMode :: Arm {
234236 2
235237 } else {
You can’t perform that action at this time.
0 commit comments