diff options
| author | serpilliere <devnull@localhost> | 2014-06-16 10:31:05 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2014-06-16 10:31:05 +0200 |
| commit | e862e45e87e4a238f137db5868be7608dd687611 (patch) | |
| tree | 03a91e6542d2d50b9938cf7eb5c19bab3b6410b7 | |
| parent | eaba82b19835d56ed1e012538d44529a68192c4b (diff) | |
| download | miasm-e862e45e87e4a238f137db5868be7608dd687611.tar.gz miasm-e862e45e87e4a238f137db5868be7608dd687611.zip | |
Jit python: handle jump to ExprId (asm_label)
| -rw-r--r-- | miasm2/jitter/jitcore_python.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/miasm2/jitter/jitcore_python.py b/miasm2/jitter/jitcore_python.py index afa9b0fe..e054efa5 100644 --- a/miasm2/jitter/jitcore_python.py +++ b/miasm2/jitter/jitcore_python.py @@ -84,8 +84,9 @@ class JitCore_Python(jitcore.JitCore): if irb.label == cur_label: loop = True break - if loop is False: - break + + # Irblocs must end with returning an ExprInt instance + assert(loop is not False) # Refresh CPU values according to @cpu instance for symbol in exec_engine.symbols: @@ -115,6 +116,8 @@ class JitCore_Python(jitcore.JitCore): # Manage resulting address if isinstance(ad, m2_expr.ExprInt): return ad.arg.arg + elif isinstance(ad, m2_expr.ExprId): + cur_label = ad.name else: raise NotImplementedError("Type not handled: %s" % ad) |