diff options
| author | Ajax <commial@gmail.com> | 2018-02-15 14:16:08 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2018-02-15 15:45:24 +0100 |
| commit | 2420df074cd2f3bb8b1e343a5bce6b83fffa9d80 (patch) | |
| tree | b97a1b5d0dbd6b686b12a0f01e32df5e63b07725 /miasm2/expression/expression.py | |
| parent | e71a3def7f936f5738d6988755d853601e84d184 (diff) | |
| download | miasm-2420df074cd2f3bb8b1e343a5bce6b83fffa9d80.tar.gz miasm-2420df074cd2f3bb8b1e343a5bce6b83fffa9d80.zip | |
Remove the default size of ExprMem expressions
Diffstat (limited to 'miasm2/expression/expression.py')
| -rw-r--r-- | miasm2/expression/expression.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/miasm2/expression/expression.py b/miasm2/expression/expression.py index 59840b5b..f0491f1a 100644 --- a/miasm2/expression/expression.py +++ b/miasm2/expression/expression.py @@ -787,11 +787,14 @@ class ExprMem(Expr): __slots__ = Expr.__slots__ + ["_arg"] - def __init__(self, arg, size=32): + def __init__(self, arg, size=None): """Create an ExprMem @arg: Expr, memory access address @size: int, memory access size """ + if size is None: + warnings.warn('DEPRECATION WARNING: size is a mandatory argument: use ExprMem(arg, SIZE)') + size = 32 # arg must be Expr assert isinstance(arg, Expr) @@ -810,7 +813,7 @@ class ExprMem(Expr): state = self._arg, self._size return self.__class__, state - def __new__(cls, arg, size=32): + def __new__(cls, arg, size=None): return Expr.get_object(cls, (arg, size)) def __str__(self): |