about summary refs log tree commit diff stats
path: root/miasm2/arch/mep/sem.py
diff options
context:
space:
mode:
authorFabrice Desclaux <fabrice.desclaux@cea.fr>2018-08-20 07:55:19 +0200
committerFabrice Desclaux <fabrice.desclaux@cea.fr>2018-08-29 17:54:10 +0200
commit2331fb1758dee9e8dbe9a8d2cf666552f29539ee (patch)
treeb84db8a900140fd17150de23b355879bf128c456 /miasm2/arch/mep/sem.py
parent7f2a6b0ad2d813f0790de7571f1811c46f668a03 (diff)
downloadmiasm-2331fb1758dee9e8dbe9a8d2cf666552f29539ee.tar.gz
miasm-2331fb1758dee9e8dbe9a8d2cf666552f29539ee.zip
Mep: use correct operator in IR
Diffstat (limited to '')
-rw-r--r--miasm2/arch/mep/sem.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/miasm2/arch/mep/sem.py b/miasm2/arch/mep/sem.py
index e1d4c5fa..e779b970 100644
--- a/miasm2/arch/mep/sem.py
+++ b/miasm2/arch/mep/sem.py
@@ -912,7 +912,12 @@ def div(rn, rm):
 
     # Check if both numbers are positive or negative
     are_both_neg = sign_rn & sign_rm
-    are_both_pos = "=="(are_both_neg, sign_mask)
+    are_both_pos = ExprCond(
+        are_both_neg - sign_mask,
+        ExprInt(0, are_both_neg.size),
+        ExprInt(1, are_both_neg.size)
+    )
+
 
     # Invert both numbers
     rn_inv = ~rn + i32(1)