Commit 7e479431 authored by Stefan Behnel's avatar Stefan Behnel

be a little more relaxed about temping in assignments (looks like some things...

be a little more relaxed about temping in assignments (looks like some things still can't be moved to a temp...)
parent 759e8ee0
...@@ -4640,7 +4640,8 @@ class SingleAssignmentNode(AssignmentNode): ...@@ -4640,7 +4640,8 @@ class SingleAssignmentNode(AssignmentNode):
dtype = self.lhs.type dtype = self.lhs.type
self.rhs = self.rhs.coerce_to(dtype, env) self.rhs = self.rhs.coerce_to(dtype, env)
if use_temp or not self.rhs.is_name: if use_temp or self.rhs.is_attribute or (
not self.rhs.is_name and self.rhs.type.is_pyobject):
# things like (cdef) attribute access are not safe (traverses pointers) # things like (cdef) attribute access are not safe (traverses pointers)
self.rhs = self.rhs.coerce_to_temp(env) self.rhs = self.rhs.coerce_to_temp(env)
elif self.rhs.type.is_pyobject: elif self.rhs.type.is_pyobject:
...@@ -4684,10 +4685,10 @@ class CascadedAssignmentNode(AssignmentNode): ...@@ -4684,10 +4685,10 @@ class CascadedAssignmentNode(AssignmentNode):
from ExprNodes import CloneNode, ProxyNode from ExprNodes import CloneNode, ProxyNode
rhs = self.rhs.analyse_types(env) rhs = self.rhs.analyse_types(env)
if rhs.is_name: if use_temp or self.rhs.is_attribute or self.rhs.type.is_pyobject:
rhs = rhs.coerce_to_simple(env)
else:
rhs = rhs.coerce_to_temp(env) rhs = rhs.coerce_to_temp(env)
elif rhs.is_name:
rhs = rhs.coerce_to_simple(env)
self.rhs = ProxyNode(rhs) self.rhs = ProxyNode(rhs)
self.coerced_rhs_list = [] self.coerced_rhs_list = []
......
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