Commit 0cb2cdb4 authored by Stefan Behnel's avatar Stefan Behnel

remember constant values during new constant node creation

parent 172daf17
...@@ -799,8 +799,9 @@ class IntNode(ConstNode): ...@@ -799,8 +799,9 @@ class IntNode(ConstNode):
if self.type is dst_type: if self.type is dst_type:
return self return self
elif dst_type.is_float: elif dst_type.is_float:
return FloatNode(self.pos, value=repr(float(self.value))) float_value = float(self.value)
node = IntNode(self.pos, value=self.value, return FloatNode(self.pos, value=repr(float_value), constant_result=float_value)
node = IntNode(self.pos, value=self.value, constant_result=self.constant_result,
unsigned=self.unsigned, longness=self.longness) unsigned=self.unsigned, longness=self.longness)
if dst_type.is_numeric and not dst_type.is_complex: if dst_type.is_numeric and not dst_type.is_complex:
return node return node
......
Markdown is supported
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