diff options
Diffstat (limited to 'miasm2/analysis')
| -rw-r--r-- | miasm2/analysis/cst_propag.py | 5 | ||||
| -rw-r--r-- | miasm2/analysis/data_flow.py | 2 | ||||
| -rw-r--r-- | miasm2/analysis/depgraph.py | 7 | ||||
| -rw-r--r-- | miasm2/analysis/expression_range.py | 1 | ||||
| -rw-r--r-- | miasm2/analysis/ssa.py | 2 |
5 files changed, 9 insertions, 8 deletions
diff --git a/miasm2/analysis/cst_propag.py b/miasm2/analysis/cst_propag.py index 7f74324f..48d588c8 100644 --- a/miasm2/analysis/cst_propag.py +++ b/miasm2/analysis/cst_propag.py @@ -52,9 +52,8 @@ def is_expr_cst(ir_arch, expr): if element.is_int(): continue return False - else: - # Expr is a constant - return True + # Expr is a constant + return True class SymbExecStateFix(SymbolicExecutionEngine): diff --git a/miasm2/analysis/data_flow.py b/miasm2/analysis/data_flow.py index f3881df9..83dae92d 100644 --- a/miasm2/analysis/data_flow.py +++ b/miasm2/analysis/data_flow.py @@ -957,7 +957,7 @@ def read_mem(bs, expr): var_bytes = bs.getbytes(ptr, expr.size / 8)[::-1] try: value = int(var_bytes.encode('hex'), 16) - except: + except ValueError: return expr return ExprInt(value, expr.size) diff --git a/miasm2/analysis/depgraph.py b/miasm2/analysis/depgraph.py index 46a83d2d..0d4a3719 100644 --- a/miasm2/analysis/depgraph.py +++ b/miasm2/analysis/depgraph.py @@ -50,6 +50,9 @@ class DependencyNode(object): self.element == depnode.element and self.line_nb == depnode.line_nb) + def __ne__(self, other): + return not self.__eq__(other) + def __cmp__(self, node): """Compares @self with @node.""" if not isinstance(node, self.__class__): @@ -195,8 +198,9 @@ class DependencyResult(DependencyState): """Container and methods for DependencyGraph results""" def __init__(self, ircfg, initial_state, state, inputs): + + super(DependencyResult, self).__init__(state.loc_key, state.pending) self.initial_state = initial_state - self.loc_key = state.loc_key self.history = state.history self.pending = state.pending self.line_nb = state.line_nb @@ -205,7 +209,6 @@ class DependencyResult(DependencyState): self._ircfg = ircfg # Init lazy elements - self._graph = None self._has_loop = None @property diff --git a/miasm2/analysis/expression_range.py b/miasm2/analysis/expression_range.py index a2c4a8df..f09a18d0 100644 --- a/miasm2/analysis/expression_range.py +++ b/miasm2/analysis/expression_range.py @@ -8,7 +8,6 @@ _op_range_handler = { "|": lambda x, y: x | y, "^": lambda x, y: x ^ y, "*": lambda x, y: x * y, - ">>": lambda x, y: x >> y, "a>>": lambda x, y: x.arithmetic_shift_right(y), "<<": lambda x, y: x << y, ">>": lambda x, y: x >> y, diff --git a/miasm2/analysis/ssa.py b/miasm2/analysis/ssa.py index a8a50351..61aa987f 100644 --- a/miasm2/analysis/ssa.py +++ b/miasm2/analysis/ssa.py @@ -509,7 +509,7 @@ class SSADiGraph(SSA): self._rename_phi_rhs(successor) # Save current SSA variable stack for successors in the dominator tree - for successor in dominator_tree.successors_iter(loc_key): + for _ in dominator_tree.successors_iter(loc_key): stack.append(self._stack_rhs) def _rename_phi_lhs(self, loc_key): |