Commit cab1d35c authored by root's avatar root

Deepcopy original bounds to avoid potential tree double references.

parent db144000
...@@ -680,13 +680,13 @@ class IterationTransform(Visitor.EnvTransform): ...@@ -680,13 +680,13 @@ class IterationTransform(Visitor.EnvTransform):
spanning_step_type = PyrexTypes.spanning_type(spanning_type, step.type) spanning_step_type = PyrexTypes.spanning_type(spanning_type, step.type)
if step_value < 0: if step_value < 0:
begin_value = copy.copy(bound2) begin_value = copy.deepcopy(bound2)
end_value = copy.copy(bound1) end_value = copy.deepcopy(bound1)
final_op = '-' final_op = '-'
final_node = ExprNodes.SubNode final_node = ExprNodes.SubNode
else: else:
begin_value = copy.copy(bound1) begin_value = copy.deepcopy(bound1)
end_value = copy.copy(bound2) end_value = copy.deepcopy(bound2)
final_op = '+' final_op = '+'
final_node = ExprNodes.AddNode final_node = ExprNodes.AddNode
...@@ -694,7 +694,7 @@ class IterationTransform(Visitor.EnvTransform): ...@@ -694,7 +694,7 @@ class IterationTransform(Visitor.EnvTransform):
bound1.pos, bound1.pos,
operand1=final_node( operand1=final_node(
bound1.pos, bound1.pos,
operand1=copy.copy(bound2), operand1=copy.deepcopy(bound2),
operator=final_op, operator=final_op,
operand2=ExprNodes.MulNode( operand2=ExprNodes.MulNode(
bound1.pos, bound1.pos,
......
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