diff options
| author | Camille Mougey <commial@gmail.com> | 2018-12-09 18:17:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-09 18:17:03 +0100 |
| commit | 68e93fbd8a637e6a2d57e4ea26a1306b14744bd6 (patch) | |
| tree | aab491b8764cbd5e1f2990284e0c50e16849f2b4 /miasm2/expression/expression.py | |
| parent | a2e6d20b83e66a1b049abec33317ff2e97d3943a (diff) | |
| parent | 43d49bbd745124a9e412bc54dbeebbaf2544a334 (diff) | |
| download | miasm-68e93fbd8a637e6a2d57e4ea26a1306b14744bd6.tar.gz miasm-68e93fbd8a637e6a2d57e4ea26a1306b14744bd6.zip | |
Merge pull request #900 from serpilliere/expr_replace_fix_arg
Expr: fix replace_expr args
Diffstat (limited to 'miasm2/expression/expression.py')
| -rw-r--r-- | miasm2/expression/expression.py | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/miasm2/expression/expression.py b/miasm2/expression/expression.py index 0e4b7629..4dc16f75 100644 --- a/miasm2/expression/expression.py +++ b/miasm2/expression/expression.py @@ -313,13 +313,10 @@ class Expr(object): def __deepcopy__(self, _): return self.copy() - def replace_expr(self, dct=None): + def replace_expr(self, dct): """Find and replace sub expression using dct - @dct: dictionary of Expr -> * + @dct: dictionary associating replaced Expr to its new Expr value """ - if not dct: - return self - return self.visit(lambda expr: dct.get(expr, expr)) def canonize(self): |