Skip to content

Commit c6cb9c1

Browse files
committed
ARM: support for lifting of predicated instructions
1 parent 1828a2d commit c6cb9c1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

chb/arm/ARMInstruction.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ def opcode(self) -> ARMOpcode:
9898
self._opcode = self.armdictionary.read_xml_arm_opcode(self.xnode)
9999
return self._opcode
100100

101+
def has_control_flow(self) -> bool:
102+
brcc = self.xnode.get("brcc")
103+
return brcc is not None
104+
101105
@property
102106
def xdata(self) -> InstrXData:
103107
if self._xdata is None:
@@ -306,6 +310,20 @@ def ast_condition_prov(
306310
expr = astree.mk_integer_constant(0)
307311
return (expr, expr)
308312

313+
def ast_cc_condition_prov(
314+
self, astree: ASTInterface
315+
) -> Tuple[Optional[ASTExpr], Optional[ASTExpr]]:
316+
317+
try:
318+
return self.opcode.ast_cc_condition_prov(
319+
astree, self.iaddr, self.bytestring, self.xdata)
320+
except Exception as e:
321+
chklogger.logger.warning(
322+
"Error in generating cc-condition at address %s: %s.",
323+
self.iaddr, str(e))
324+
expr = astree.mk_temp_lval_expression()
325+
return (expr, expr)
326+
309327
def ast_switch_condition_prov(self, astree: ASTInterface) -> Tuple[
310328
Optional[ASTExpr], Optional[ASTExpr]]:
311329

0 commit comments

Comments
 (0)