Skip to content

Commit 0989a52

Browse files
committed
ARM: use c expression in switch condition
1 parent 6ca4f34 commit 0989a52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

chb/arm/ARMInstruction.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,10 @@ def ast_switch_condition_prov(self, astree: ASTInterface) -> Tuple[
336336
jumptable = cast(
337337
"ARMJumpTable", self.armfunction.get_jumptable(self.iaddr))
338338
indexop = jumptable.index_operand
339-
condition = self.xdata.xprs_r[1]
339+
if self.xdata.is_cxpr_ok(0):
340+
condition = self.xdata.cxprs_r[0]
341+
else:
342+
condition = self.xdata.xprs_r[1]
340343
if condition is not None:
341344
(ll_cond, _, _) = indexop.ast_rvalue(astree)
342345
hl_cond = XU.xxpr_to_ast_def_expr(

0 commit comments

Comments
 (0)