about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2017-01-04 17:57:40 +0100
committerAjax <commial@gmail.com>2017-01-05 14:55:45 +0100
commit2035e7a6d4484e0abc7c97033cff42a16739e0c6 (patch)
tree22631247afb45cf2d0642d798cbf6f4b8e255218
parente3fd54d6b11fc4f1b9ebaaf2526a3be363d1855c (diff)
downloadmiasm-2035e7a6d4484e0abc7c97033cff42a16739e0c6.tar.gz
miasm-2035e7a6d4484e0abc7c97033cff42a16739e0c6.zip
Promote ExprId to float if they belong to archiitecture float_list
There aren't distinguishable based on the Expr instance
Diffstat (limited to '')
-rw-r--r--miasm2/jitter/llvmconvert.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/miasm2/jitter/llvmconvert.py b/miasm2/jitter/llvmconvert.py
index 214725ad..bc1c48ca 100644
--- a/miasm2/jitter/llvmconvert.py
+++ b/miasm2/jitter/llvmconvert.py
@@ -418,9 +418,13 @@ class LLVMFunction():
         ptr = builder.gep(self.local_vars["vmcpu"],
                           [llvm_ir.Constant(LLVMType.IntType(),
                                             offset)])
-        int_size = LLVMType.IntType(expr.size)
+        regs = self.llvm_context.ir_arch.arch.regs
+        if hasattr(regs, "float_list") and expr in regs.float_list:
+            pointee_type = llvm_ir.DoubleType()
+        else:
+            pointee_type = LLVMType.IntType(expr.size)
         ptr_casted = builder.bitcast(ptr,
-                                     llvm_ir.PointerType(int_size))
+                                     llvm_ir.PointerType(pointee_type))
         # Store in cache
         self.local_vars_pointers[name] = ptr_casted