#NEWLINE# @ staticmethod #NEWLINE# def _last_branching_statement( statements ) : #NEWLINE# #INDENT# '\n        Search for the last branching exit, just like\n        #   if (t12) { PUT(184) = 0xBADF00D:I64; exit-Boring }\n        and then taint the temp variable inside if predicate\n        ' #NEWLINE# cmp_stmt_id = None #NEWLINE# cmp_tmp_id = None #NEWLINE# all_statements = len ( statements ) #NEWLINE# statements = reversed ( statements ) #NEWLINE# for ( stmt_rev_idx , stmt ) in enumerate ( statements ) : #NEWLINE# #INDENT# stmt_idx = ( ( all_statements - stmt_rev_idx ) - 1 ) #NEWLINE# actions = stmt . actions #NEWLINE# has_code_action = False #NEWLINE# for a in actions : #NEWLINE# #INDENT# if isinstance ( a , simuvex . SimActionExit ) : #NEWLINE# #INDENT# has_code_action = True #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# if has_code_action : #NEWLINE# #INDENT# readtmp_action = next ( ifilter ( ( lambda r : ( ( r . type == 'tmp' ) and ( r . action == 'read' ) ) ) , actions ) , None ) #NEWLINE# if ( readtmp_action is not None ) : #NEWLINE# #INDENT# cmp_tmp_id = readtmp_action . tmp #NEWLINE# cmp_stmt_id = stmt_idx #NEWLINE# break #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise AngrBackwardSlicingError ( 'ReadTempAction is not found. Please report to Fish.' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( cmp_stmt_id , cmp_tmp_id )