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.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/miasm2/jitter/jitcore_python.py b/miasm2/jitter/jitcore_python.py
index 70131157..87259f71 100644
--- a/miasm2/jitter/jitcore_python.py
+++ b/miasm2/jitter/jitcore_python.py
@@ -91,17 +91,18 @@ class JitCore_Python(jitcore.JitCore):
                         if self.log_mn:
                             print "%08x %s" % (line.offset, line)
 
-                        # Check for memory exception
-                        if (vmmngr.get_exception() != 0):
+                        # Check for exception
+                        if (vmmngr.get_exception() != 0 or
+                            cpu.get_exception() != 0):
                             exec_engine.update_cpu_from_engine()
                             return line.offset
 
                     # Eval current instruction (in IR)
                     exec_engine.eval_ir(ir)
-
-                    # Check for memory exception which do not update PC
-                    if (vmmngr.get_exception() & csts.EXCEPT_DO_NOT_UPDATE_PC != 0):
-                        exec_engine.update_cpu_from_engine()
+                    # Check for exceptions which do not update PC
+                    exec_engine.update_cpu_from_engine()
+                    if (vmmngr.get_exception() & csts.EXCEPT_DO_NOT_UPDATE_PC != 0 or
+                        cpu.get_exception() > csts.EXCEPT_NUM_UPDT_EIP):
                         return line.offset
 
                 vmmngr.check_invalid_code_blocs()