diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-04-26 12:19:34 +0200 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-04-26 12:19:34 +0200 |
| commit | aa48fbea3eb5b82e930a187a3f0b3838919cd2f4 (patch) | |
| tree | 242802536c71717d07e813c873fe1804212c7b0a /miasm2/expression/expression.py | |
| parent | 00fec850c118cd23623761fb1f45b8f381d8fc15 (diff) | |
| download | miasm-aa48fbea3eb5b82e930a187a3f0b3838919cd2f4.tar.gz miasm-aa48fbea3eb5b82e930a187a3f0b3838919cd2f4.zip | |
Expr: Fix default size
Diffstat (limited to '')
| -rw-r--r-- | miasm2/expression/expression.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/miasm2/expression/expression.py b/miasm2/expression/expression.py index f0491f1a..54cd5a2d 100644 --- a/miasm2/expression/expression.py +++ b/miasm2/expression/expression.py @@ -149,7 +149,6 @@ class Expr(object): __slots__ = ["_hash", "_repr", "_size"] - all_exprs = set() args2expr = {} canon_exprs = set() use_singleton = True @@ -543,6 +542,9 @@ class ExprId(Expr): return self.__class__, state def __new__(cls, name, size=None): + if size is None: + warnings.warn('DEPRECATION WARNING: size is a mandatory argument: use ExprId(name, SIZE)') + size = 32 return Expr.get_object(cls, (name, size)) def __str__(self): @@ -814,6 +816,10 @@ class ExprMem(Expr): return self.__class__, state def __new__(cls, arg, size=None): + if size is None: + warnings.warn('DEPRECATION WARNING: size is a mandatory argument: use ExprMem(arg, SIZE)') + size = 32 + return Expr.get_object(cls, (arg, size)) def __str__(self): |