diff options
Diffstat (limited to 'miasm2/jitter/llvmconvert.py')
| -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 |