diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2017-02-12 18:51:29 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2017-02-12 18:51:29 +0100 |
| commit | 4cadfcf63e4e74918f022d24c5efa56aafbaff12 (patch) | |
| tree | 248eef50d915fc3eb8fec634318f6492af6d0f27 /miasm2/jitter/llvmconvert.py | |
| parent | bf4eeb159e07333b90d81ca1ff26591ad9f81fc2 (diff) | |
| download | miasm-4cadfcf63e4e74918f022d24c5efa56aafbaff12.tar.gz miasm-4cadfcf63e4e74918f022d24c5efa56aafbaff12.zip | |
Jitter: remove useless segm trunc
Diffstat (limited to '')
| -rw-r--r-- | miasm2/jitter/llvmconvert.py | 7 |
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 |