[docs]defpostprocess(self):ifself.irsb.statementsisNone:# This is an optimized IRSB. We cannot really post-process it.returninsertions=[]last_ip=0fori,sinenumerate(self.irsb.statements):ifs.tag=="Ist_IMark":last_ip=s.addrifs.tag=="Ist_WrTmp"ands.data.tag=="Iex_Binop"and("Div"ins.data.opor"Mod"ins.data.op):arg_size=s.data.args[1].result_size(self.irsb.tyenv)cmp_args=[copy.copy(s.data.args[1]),expr.Const(const.vex_int_class(arg_size)(0))]cmp_tmp=self.irsb.tyenv.add("Ity_I1")insertions.append((i,stmt.WrTmp(cmp_tmp,expr.Binop("Iop_CmpEQ%d"%arg_size,cmp_args))))insertions.append((i,stmt.Exit(expr.RdTmp.get_instance(cmp_tmp),const.vex_int_class(self.irsb.arch.bits)(last_ip),"Ijk_SigFPE_IntDiv",self.irsb.offsIP,),))fori,sinreversed(insertions):self.irsb.statements.insert(i,s)