diff options
| author | Ajax <commial@gmail.com> | 2016-01-30 23:11:54 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2016-01-30 23:11:54 +0100 |
| commit | 9b6c327d81ded9eb777130d7a4efb1dbe8a78c77 (patch) | |
| tree | bd6002a816a67d9f74434b62df675c36c4e538c2 /miasm2/ir | |
| parent | 3672de7c319f39273cb7e34797cb928f424ff7c4 (diff) | |
| download | miasm-9b6c327d81ded9eb777130d7a4efb1dbe8a78c77.tar.gz miasm-9b6c327d81ded9eb777130d7a4efb1dbe8a78c77.zip | |
Fix dangerous-default-value
Diffstat (limited to 'miasm2/ir')
| -rw-r--r-- | miasm2/ir/ir.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index 122ce6d0..14acb907 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -30,8 +30,10 @@ from miasm2.core.graph import DiGraph class irbloc(object): - def __init__(self, label, irs, lines=[]): + def __init__(self, label, irs, lines=None): assert(isinstance(label, asm_label)) + if lines is None: + lines = [] self.label = label self.irs = irs self.lines = lines @@ -133,7 +135,7 @@ class DiGraphIR(DiGraph): def node2lines(self, node): yield self.DotCellDescription(text=str(node.name), attr={'align': 'center', - 'colspan': 2, + 'colspan': 2, 'bgcolor': 'grey'}) if node not in self._blocks: yield [self.DotCellDescription(text="NOT PRESENT", attr={})] @@ -384,11 +386,13 @@ class ir(object): for i, l in enumerate(irs): irs[i] = l.replace_expr(rep) - def get_rw(self, regs_ids=[]): + def get_rw(self, regs_ids=None): """ Calls get_rw(irb) for each bloc @regs_ids : ids of registers used in IR """ + if regs_ids is None: + regs_ids = [] for b in self.blocs.values(): b.get_rw(regs_ids) |