diff options
| author | Ajax <commial@gmail.com> | 2017-05-09 14:05:54 +0200 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2017-05-09 14:05:54 +0200 |
| commit | 66fbc8550af1de64372d1653dc9fee5a83541907 (patch) | |
| tree | cc5532a793499a0f812069ee623591932a576810 | |
| parent | 1548b4f389151fec11e6908b6186b5fa55866e08 (diff) | |
| download | miasm-66fbc8550af1de64372d1653dc9fee5a83541907.tar.gz miasm-66fbc8550af1de64372d1653dc9fee5a83541907.zip | |
Add a sanity check for AssignBlock (dst must be Id or Mem)
Diffstat (limited to '')
| -rw-r--r-- | miasm2/ir/ir.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/miasm2/ir/ir.py b/miasm2/ir/ir.py index e5f0c8db..1d720e1f 100644 --- a/miasm2/ir/ir.py +++ b/miasm2/ir/ir.py @@ -124,6 +124,10 @@ class AssignBlock(object): args = [expr for (expr, _, _) in args] new_src = m2_expr.ExprCompose(*args) + # Sanity check + if not isinstance(new_dst, (m2_expr.ExprId, m2_expr.ExprMem)): + raise TypeError("Destination cannot be a %s" % type(new_dst)) + self._assigns[new_dst] = new_src def __setitem__(self, dst, src): |