about summary refs log tree commit diff stats
path: root/miasm2/jitter/jitcore.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2016-11-10 12:23:50 +0100
committerGitHub <noreply@github.com>2016-11-10 12:23:50 +0100
commit5f728a282520b5b98de64053d98b935b206b61c1 (patch)
tree6bd503d3012265613d06d47191bd6c5144fa166a /miasm2/jitter/jitcore.py
parentc106fd74add334b24533156820072a3558b1a725 (diff)
parent0aa399dd85f33de8334e2ebc579cc336acf9a7d3 (diff)
downloadmiasm-5f728a282520b5b98de64053d98b935b206b61c1.tar.gz
miasm-5f728a282520b5b98de64053d98b935b206b61c1.zip
Merge pull request #450 from serpilliere/add_emul_block_limit
Jitter: Add max exec per jit call option
Diffstat (limited to 'miasm2/jitter/jitcore.py')
-rw-r--r--miasm2/jitter/jitcore.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/miasm2/jitter/jitcore.py b/miasm2/jitter/jitcore.py
index 04bd707a..f3a79bee 100644
--- a/miasm2/jitter/jitcore.py
+++ b/miasm2/jitter/jitcore.py
@@ -51,7 +51,8 @@ class JitCore(object):
         self.blocs_mem_interval = interval()
         self.disasm_cb = None
         self.split_dis = set()
-        self.options = {"jit_maxline": 50  # Maximum number of line jitted
+        self.options = {"jit_maxline": 50,  # Maximum number of line jitted
+                        "max_exec_per_call": 0 # 0 means no limit
                         }
 
         self.mdis = asmbloc.disasmEngine(ir_arch.arch, ir_arch.attrib, bs,
@@ -170,7 +171,8 @@ class JitCore(object):
         @cpu: JitCpu instance
         @breakpoints: Dict instance of used breakpoints
         """
-        return self.exec_wrapper(label, cpu, self.lbl2jitbloc.data, breakpoints)
+        return self.exec_wrapper(label, cpu, self.lbl2jitbloc.data, breakpoints,
+                                 self.options["max_exec_per_call"])
 
     def runbloc(self, cpu, vm, lbl, breakpoints):
         """Run the bloc starting at lbl.