diff options
| author | iximeow <me@iximeow.net> | 2026-07-26 17:56:26 +0000 |
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2026-07-28 07:28:15 +0000 |
| commit | 9b3c56c0e62c3d1c27ffef4b8021663798b73ca7 (patch) | |
| tree | 212b04bd20e3a1b1ec1e9e2296986389b70ef31d /src/armv7/thumb.rs | |
| parent | 019920be5aa0b3b129a4ecf3bc31c14fddf34eff (diff) | |
thumb: when nonconforming, allow it/cond=1111 like capstone
Diffstat (limited to 'src/armv7/thumb.rs')
| -rw-r--r-- | src/armv7/thumb.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/armv7/thumb.rs b/src/armv7/thumb.rs index 7aa3a5d..9e9c30a 100644 --- a/src/armv7/thumb.rs +++ b/src/armv7/thumb.rs @@ -3918,8 +3918,13 @@ pub fn decode_into<T: Reader<<ARMv7 as Arch>::Address, <ARMv7 as Arch>::Word>>(d let firstcond = opa; let mask = opb; inst.opcode = Opcode::IT; - if firstcond == 0b1111 { - return Err(DecodeError::InvalidOperand); + if decoder.should_is_must { + // > if firstcond == ‘1111’ || + // > (firstcond == ‘1110’ && BitCount(mask) != 1) + // > then UNPREDICTABLE; + if firstcond == 0b1111 { + return Err(DecodeError::Nonconforming); + } } inst.operands = [ Operand::Imm32(firstcond), |
