Commit 0c503cdc authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Cast Length operator properly with comparison

parent 6e976299
...@@ -1829,9 +1829,9 @@ def _equality(expr): ...@@ -1829,9 +1829,9 @@ def _equality(expr):
if basic: if basic:
# Cast in case a side is using a 32bits ints (eg when using Length(..)) # Cast in case a side is using a 32bits ints (eg when using Length(..))
if lbty.kind == 'IntegerType' and rbty.kind != lbty.kind: if lbty.kind == 'IntegerType' and rbty.kind != lbty.kind:
right_str = u'Asn1Int({})'.format(right_str) right_str = u'{}({})'.format(type_name(lbty), right_str)
elif rbty.kind == 'IntegerType' and lbty.kind != rbty.kind: elif rbty.kind == 'IntegerType' and lbty.kind != rbty.kind:
left_str = u'Asn1Int({})'.format(left_str) left_str = u'{}({})'.format(type_name(rbty), left_str)
ada_string = u'({left} {op} {right})'.format( ada_string = u'({left} {op} {right})'.format(
left=left_str, op=expr.operand, right=right_str) left=left_str, op=expr.operand, right=right_str)
else: else:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment