about summary refs log tree commit diff stats
path: root/miasm2/jitter/llvmconvert.py
diff options
context:
space:
mode:
authorCamille Mougey <commial@gmail.com>2017-02-13 09:41:39 +0100
committerGitHub <noreply@github.com>2017-02-13 09:41:39 +0100
commit827c6cb8e1cdcc6e501c319353f89615b9cc09c9 (patch)
tree248eef50d915fc3eb8fec634318f6492af6d0f27 /miasm2/jitter/llvmconvert.py
parent1719580d49d297f8b9b647569372e3eff888fbdf (diff)
parent4cadfcf63e4e74918f022d24c5efa56aafbaff12 (diff)
downloadmiasm-827c6cb8e1cdcc6e501c319353f89615b9cc09c9.tar.gz
miasm-827c6cb8e1cdcc6e501c319353f89615b9cc09c9.zip
Merge pull request #492 from serpilliere/fix_mem_accesses
Fix mem accesses
Diffstat (limited to 'miasm2/jitter/llvmconvert.py')
-rw-r--r--miasm2/jitter/llvmconvert.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/miasm2/jitter/llvmconvert.py b/miasm2/jitter/llvmconvert.py
index bc04689c..527dc733 100644
--- a/miasm2/jitter/llvmconvert.py
+++ b/miasm2/jitter/llvmconvert.py
@@ -735,11 +735,8 @@ class LLVMFunction():
 
                 ret = builder.call(fc_ptr,
                                    [self.local_vars["jitcpu"]] + casted_args)
-                # Ret size is not expr.size on segm2addr (which is the size of
-                # the segment, for instance 16 bits), but the size of an addr
-                ret_size = self.llvm_context.PC.size
-                if ret.type.width > ret_size:
-                    ret = builder.trunc(ret, LLVMType.IntType(ret_size))
+                if ret.type.width > expr.size:
+                    ret = builder.trunc(ret, LLVMType.IntType(expr.size))
                 self.update_cache(expr, ret)
                 return ret