about summary refs log tree commit diff stats
path: root/miasm2/jitter/llvmconvert.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2016-12-23 15:08:54 +0100
committerAjax <commial@gmail.com>2017-01-04 17:14:55 +0100
commitecb30067cb14ea5924699abbd8bbe79c9330fbcf (patch)
treeb9aa26be0eb24141a9f2129fd74ffda2127d4627 /miasm2/jitter/llvmconvert.py
parentc91a1779f3bc4a0690f51a906f1e1eb32a8e76a6 (diff)
downloadmiasm-ecb30067cb14ea5924699abbd8bbe79c9330fbcf.tar.gz
miasm-ecb30067cb14ea5924699abbd8bbe79c9330fbcf.zip
LLVM: Handle '-' operation with 2 operands
At the time of writting, x86 AAS instruction, for instance, generate this
kind of Expression
Diffstat (limited to '')
-rw-r--r--miasm2/jitter/llvmconvert.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/miasm2/jitter/llvmconvert.py b/miasm2/jitter/llvmconvert.py
index 70a2f3de..cb6a5011 100644
--- a/miasm2/jitter/llvmconvert.py
+++ b/miasm2/jitter/llvmconvert.py
@@ -572,8 +572,9 @@ class LLVMFunction():
                 return ret
 
             if op == "-":
-                zero = llvm_ir.Constant(LLVMType.IntType(expr.size),
-                                        0)
+                # Unsupported op '-' with more than 1 arg
+                assert len(expr.args) == 1
+                zero = LLVMType.IntType(expr.size)(0)
                 ret = builder.sub(zero, self.add_ir(expr.args[0]))
                 self.update_cache(expr, ret)
                 return ret