diff options
| author | Camille Mougey <commial@gmail.com> | 2018-06-09 09:05:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-09 09:05:05 +0200 |
| commit | 990060f21e515ff1a25246f8fdf0936a97ac698f (patch) | |
| tree | b10543391f9a66ddd5e3f6852c30d96b169b623d /miasm2/jitter/jitcore_llvm.py | |
| parent | dadfaabc3fff5edb9bf4ef7e7e8c4cfc4baccb94 (diff) | |
| parent | 61551fa78e9dd22ed1f982b4fe171fd6383c39a6 (diff) | |
| download | miasm-990060f21e515ff1a25246f8fdf0936a97ac698f.tar.gz miasm-990060f21e515ff1a25246f8fdf0936a97ac698f.zip | |
Merge pull request #751 from serpilliere/ExprLabel
Expr Loc
Diffstat (limited to 'miasm2/jitter/jitcore_llvm.py')
| -rw-r--r-- | miasm2/jitter/jitcore_llvm.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/miasm2/jitter/jitcore_llvm.py b/miasm2/jitter/jitcore_llvm.py index 452b6d84..5152cf9e 100644 --- a/miasm2/jitter/jitcore_llvm.py +++ b/miasm2/jitter/jitcore_llvm.py @@ -78,12 +78,13 @@ class JitCore_LLVM(jitcore.JitCore): """Add a block to JiT and JiT it. @block: the block to add """ + block_hash = self.hash_block(block) fname_out = os.path.join(self.tempdir, "%s.bc" % block_hash) if not os.access(fname_out, os.R_OK): # Build a function in the context - func = LLVMFunction(self.context, LLVMFunction.canonize_label_name(block.label)) + func = LLVMFunction(self.context, block.loc_key) # Set log level func.log_regs = self.log_regs @@ -114,7 +115,9 @@ class JitCore_LLVM(jitcore.JitCore): else: # The cache file exists: function can be loaded from cache - ptr = self.context.get_ptr_from_cache(fname_out, LLVMFunction.canonize_label_name(block.label)) + ptr = self.context.get_ptr_from_cache(fname_out, block.loc_key) # Store a pointer on the function jitted code - self.lbl2jitbloc[block.label.offset] = ptr + loc_key = block.loc_key + offset = self.ir_arch.symbol_pool.loc_key_to_offset(loc_key) + self.loc_key_to_jit_block[offset] = ptr |