about summary refs log tree commit diff stats
path: root/miasm2/jitter/jitcore_python.py
diff options
context:
space:
mode:
Diffstat (limited to 'miasm2/jitter/jitcore_python.py')
-rw-r--r--miasm2/jitter/jitcore_python.py7
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)