@@ -341,8 +341,12 @@ def trampoline_payload_ast(self, astree: "ASTInterface") -> AST.ASTStmt:
341341
342342 # case 1
343343 if chkinstr2 .mnemonic_stem == "MOV" :
344+ chkinstr2 = cast ("ARMInstruction" , chkinstr2 )
344345 if chkinstr2 .has_instruction_condition ():
345- condition = chkinstr2 .get_instruction_condition ()
346+ if chkinstr2 .has_valid_instruction_c_condition ():
347+ condition = chkinstr2 .get_instruction_c_condition ()
348+ else :
349+ condition = chkinstr2 .get_instruction_condition ()
346350 rstmt = astree .mk_return_stmt (None )
347351 estmt = astree .mk_instr_sequence ([])
348352 cc = XU .xxpr_to_ast_def_expr (condition ,
@@ -360,7 +364,10 @@ def trampoline_payload_ast(self, astree: "ASTInterface") -> AST.ASTStmt:
360364 if (
361365 chkinstr3 .has_instruction_condition ()
362366 and chkinstr4 .has_instruction_condition ()):
363- condition = chkinstr3 .get_instruction_condition ()
367+ if chkinstr3 .has_valid_instruction_c_condition ():
368+ condition = chkinstr3 .get_instruction_c_condition ()
369+ else :
370+ condition = chkinstr3 .get_instruction_condition ()
364371 rstmt = astree .mk_return_stmt (None )
365372 estmt = astree .mk_instr_sequence ([])
366373 cc = XU .xxpr_to_ast_def_expr (condition ,
@@ -382,7 +389,10 @@ def trampoline_payload_ast(self, astree: "ASTInterface") -> AST.ASTStmt:
382389 chkinstr3 = cast ("ARMInstruction" , chkinstr3 )
383390 if chkinstr3 .mnemonic_stem == "MOV" :
384391 if chkinstr3 .has_instruction_condition ():
385- condition = chkinstr3 .get_instruction_condition ()
392+ if chkinstr3 .has_valid_instruction_c_condition ():
393+ condition = chkinstr3 .get_instruction_c_condition ()
394+ else :
395+ condition = chkinstr3 .get_instruction_condition ()
386396 chkopc2 = chkinstr2 .opcode
387397 chkopc2 = cast ("ARMLogicalShiftLeft" , chkopc2 )
388398 lslxdata = chkopc2 .lsl_xdata (chkinstr2 .xdata )
0 commit comments