about summary refs log tree commit diff stats
path: root/miasm2/jitter/jitcore_python.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2016-02-15 15:32:00 +0100
committerAjax <commial@gmail.com>2016-02-16 08:24:25 +0100
commitc2a424eae3cea350abf9430231b243ed85b37e81 (patch)
tree4e28140f1bf0cf70a0e49469402439b4415a5301 /miasm2/jitter/jitcore_python.py
parent4be55498f8100f5b36cfc745a539738766f24912 (diff)
downloadmiasm-c2a424eae3cea350abf9430231b243ed85b37e81.tar.gz
miasm-c2a424eae3cea350abf9430231b243ed85b37e81.zip
JitCore_Python: use for ... else ... construction
Diffstat (limited to 'miasm2/jitter/jitcore_python.py')
-rw-r--r--miasm2/jitter/jitcore_python.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/miasm2/jitter/jitcore_python.py b/miasm2/jitter/jitcore_python.py
index 696ec8b0..eced9cd2 100644
--- a/miasm2/jitter/jitcore_python.py
+++ b/miasm2/jitter/jitcore_python.py
@@ -38,7 +38,6 @@ class JitCore_Python(jitcore.JitCore):
 
             # Keep current location in irblocs
             cur_label = label
-            loop = True
 
             # Required to detect new instructions
             offsets_jitted = set()
@@ -48,17 +47,15 @@ class JitCore_Python(jitcore.JitCore):
             exec_engine.cpu = cpu
 
             # For each irbloc inside irblocs
-            while loop is True:
+            while True:
 
                 # Get the current bloc
-                loop = False
                 for irb in irblocs:
                     if irb.label == cur_label:
-                        loop = True
                         break
-
-                # Irblocs must end with returning an ExprInt instance
-                assert(loop is not False)
+                else:
+                    raise RuntimeError("Irblocs must end with returning an "
+                                       "ExprInt instance")
 
                 # Refresh CPU values according to @cpu instance
                 exec_engine.update_engine_from_cpu()