From ecb30067cb14ea5924699abbd8bbe79c9330fbcf Mon Sep 17 00:00:00 2001 From: Ajax Date: Fri, 23 Dec 2016 15:08:54 +0100 Subject: LLVM: Handle '-' operation with 2 operands At the time of writting, x86 AAS instruction, for instance, generate this kind of Expression --- miasm2/jitter/llvmconvert.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'miasm2') 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 -- cgit 1.4.1