From 0989a52ed166b0be43b59c968ef3adaf5ac9f113 Mon Sep 17 00:00:00 2001 From: Henny Sipma Date: Wed, 6 Aug 2025 01:13:19 -0700 Subject: [PATCH] ARM: use c expression in switch condition --- chb/arm/ARMInstruction.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chb/arm/ARMInstruction.py b/chb/arm/ARMInstruction.py index 87cedbd1..41cabdc7 100644 --- a/chb/arm/ARMInstruction.py +++ b/chb/arm/ARMInstruction.py @@ -336,7 +336,10 @@ def ast_switch_condition_prov(self, astree: ASTInterface) -> Tuple[ jumptable = cast( "ARMJumpTable", self.armfunction.get_jumptable(self.iaddr)) indexop = jumptable.index_operand - condition = self.xdata.xprs_r[1] + if self.xdata.is_cxpr_ok(0): + condition = self.xdata.cxprs_r[0] + else: + condition = self.xdata.xprs_r[1] if condition is not None: (ll_cond, _, _) = indexop.ast_rvalue(astree) hl_cond = XU.xxpr_to_ast_def_expr(