diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-03-05 11:23:35 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2018-03-05 11:23:35 +0100 |
| commit | 5d5c768db62da037d156808f528cf9c1e14db8ab (patch) | |
| tree | 683728881150e2406849bcc1e1c13c62bc0b6d44 | |
| parent | 5155171ab9b805d26824fe1248840f4ac22de94c (diff) | |
| download | miasm-5d5c768db62da037d156808f528cf9c1e14db8ab.tar.gz miasm-5d5c768db62da037d156808f528cf9c1e14db8ab.zip | |
LLVM: fix rot 0
| -rw-r--r-- | miasm2/jitter/llvmconvert.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/miasm2/jitter/llvmconvert.py b/miasm2/jitter/llvmconvert.py index 9796b265..0e4368a8 100644 --- a/miasm2/jitter/llvmconvert.py +++ b/miasm2/jitter/llvmconvert.py @@ -777,8 +777,10 @@ class LLVMFunction(): itype = LLVMType.IntType(expr.size) expr_size = itype(expr.size) + # As shift of expr_size is undefined, we urem the shifters shift = builder.urem(count, expr_size) - shift_inv = builder.sub(expr_size, shift) + shift_inv = builder.urem(builder.sub(expr_size, shift), + expr_size) if op == '<<<': part_a = builder.shl(value, shift) |