Exemple #1
0
    def _build_vector(self, funcs):
        cvs = []

        # for each function
        for func in funcs:
            # create condition vector
            cv = CondVector(func, self.rtn)

            # collect @CONDITION for the specified return value
            rtn_dic = self.pathbin[func]
            symbol_set = set()
            for retpath in rtn_dic.get(self.rtn, []):
                conds = retpath.get_conds()
                if conds == None:
                    continue

                # create a temp. condition vector for a single path condition 
                tcv = CondVector(func, self.rtn)
                for cond in conds:
                    # first, decide whether a cond is included or not
                    if self.__filter_out_cond(cond):
                        continue
                    nexpr = filter_out_non_args(cond.expr)
                    if not have_args(nexpr):
                        continue
                    # add {nexpr, ranges} to the vector 
                    tcv.add(nexpr, rsf.build([cond.ranges]))

                # add a single path condition to the condition vector for return
                cv.add_path(tcv)

            # now, a condition vector is ready. 
            cv.normalize()
            cvs.append(cv)
        return cvs
Exemple #2
0
    def __init__(self, func, rtn, sym_ids, symbol_tbl):
        self.func = func
        self.rtn = rtn
        self.sym_ids = sym_ids  # ["0", "3", ...]
        self.symbol_tbl = symbol_tbl

        num_sym = max(len(self.sym_ids), 1)
        rs = rsf.build(self.sym_ids, range_area=100.0 * num_sym)
        RangeSetVector.__init__(self, "@LOG_STORE", rs)
Exemple #3
0
    def __init__(self, func, rtn, sym_ids, symbol_tbl):
        self.func = func
        self.rtn = rtn
        self.sym_ids = sym_ids # ["0", "3", ...]
        self.symbol_tbl = symbol_tbl

        num_sym = max(len(self.sym_ids), 1)
        rs = rsf.build(self.sym_ids, range_area = 100.0 * num_sym)
        RangeSetVector.__init__(self, "@LOG_STORE", rs)
Exemple #4
0
    def __init__(self, func, rtn_dic):
        self.func = func
        self.rtn_dic = rtn_dic

        rs = rsf.build(self.rtn_dic.keys())
        RangeSetVector.__init__(self, "@RETURN", rs)