about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2016-06-24 17:19:33 +0200
committerAjax <commial@gmail.com>2016-09-01 17:34:50 +0200
commiteebb61353ea5dd2036d1db8c3cc4aab6c1cc5662 (patch)
tree64b820e062db06d626d804371f58de7545d06349
parent569db5c25ef951069fbc8fc1cc0cdb9e3d0ae01b (diff)
downloadmiasm-eebb61353ea5dd2036d1db8c3cc4aab6c1cc5662.tar.gz
miasm-eebb61353ea5dd2036d1db8c3cc4aab6c1cc5662.zip
Use a local expr_simp, instead of activating simps on global expr_simp
-rw-r--r--miasm2/jitter/jitcore_python.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/miasm2/jitter/jitcore_python.py b/miasm2/jitter/jitcore_python.py
index ae72b307..70131157 100644
--- a/miasm2/jitter/jitcore_python.py
+++ b/miasm2/jitter/jitcore_python.py
@@ -1,7 +1,7 @@
 import miasm2.jitter.jitcore as jitcore
 import miasm2.expression.expression as m2_expr
 import miasm2.jitter.csts as csts
-from miasm2.expression.simplifications import expr_simp
+from miasm2.expression.simplifications import ExpressionSimplifier
 from miasm2.jitter.emulatedsymbexec import EmulatedSymbExec
 
 
@@ -17,8 +17,11 @@ class JitCore_Python(jitcore.JitCore):
         super(JitCore_Python, self).__init__(ir_arch, bs)
         self.ir_arch = ir_arch
 
-        # CPU & VM (None for now) will be set by the "jitted" Python function
-        self.symbexec = EmulatedSymbExec(None, None, self.ir_arch, {})
+        # CPU & VM (None for now) will be set later
+        expr_simp = ExpressionSimplifier()
+        expr_simp.enable_passes(ExpressionSimplifier.PASS_COMMONS)
+        self.symbexec = EmulatedSymbExec(None, None, self.ir_arch, {},
+                                         sb_expr_simp=expr_simp)
         self.symbexec.enable_emulated_simplifications()
 
     def set_cpu_vm(self, cpu, vm):
@@ -49,6 +52,7 @@ class JitCore_Python(jitcore.JitCore):
 
             # Get exec engine
             exec_engine = self.symbexec
+            expr_simp = exec_engine.expr_simp
 
             # For each irbloc inside irblocs
             while True: