diff options
-rwxr-xr-x | pp2cc.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1112,6 +1112,10 @@ class Parse(object): else: operand1 = self.determineConstValue(node.left) operand2 = self.determineConstValue(node.right) + if op == "-": + # ensure that the result of substraction is positive by + # setting the (WORDSIZE+1)-nth bit on the first operand + operand1 |= pow(2, self.WORDSIZE) if op in ("<", ">", "<=", ">="): value = int(getattr(operator, op)(operand1, operand2)) # 0 < 1 and -2 < -1 holds, but -1 < 0 does not. If the sign |