From 2420df074cd2f3bb8b1e343a5bce6b83fffa9d80 Mon Sep 17 00:00:00 2001 From: Ajax Date: Thu, 15 Feb 2018 14:16:08 +0100 Subject: Remove the default size of ExprMem expressions --- miasm2/expression/expression.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'miasm2/expression/expression.py') 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): -- cgit 1.4.1