From 9b3c56c0e62c3d1c27ffef4b8021663798b73ca7 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 26 Jul 2026 17:56:26 +0000 Subject: thumb: when nonconforming, allow it/cond=1111 like capstone --- src/armv7/thumb.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/armv7/thumb.rs') 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::Address, ::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), -- cgit v1.1