trailofbits/manticore

Refactor/unify repetitive pattern

Open

#1,059 opened on 2018年8月16日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Python (481 forks)batch import
ethereumhelp wantedresearch

Repository metrics

Stars
 (3,469 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

This pattern comes up pretty regularly (in Solver.get_all_values, Solver.get_value, ConstraintSet.migrate), should we make a Expression.clone() ?

                if isinstance(foreign_var, Bool):
                    new_var = self.new_bool(name=migrated_name)
                elif isinstance(foreign_var, BitVec):
                    new_var = self.new_bitvec(foreign_var.size, name=migrated_name)
                elif isinstance(foreign_var, Array):
                    # Note that we are discarding the ArrayProxy encapsulation
                    new_var = self.new_array(index_max=foreign_var.index_max, index_bits=foreign_var.index_bits, value_bits=foreign_var.value_bits, name=migrated_name).array

コントリビューターガイド