Commit eb1e7173 authored by Stefan Behnel's avatar Stefan Behnel

fix cascaded assignments of None to extension type variables

parent 3c118b8a
...@@ -4573,11 +4573,12 @@ class CascadedAssignmentNode(AssignmentNode): ...@@ -4573,11 +4573,12 @@ class CascadedAssignmentNode(AssignmentNode):
from ExprNodes import CloneNode, ProxyNode from ExprNodes import CloneNode, ProxyNode
self.rhs = self.rhs.analyse_types(env) self.rhs = self.rhs.analyse_types(env)
if use_temp or self.rhs.is_attribute: # (cdef) attribute access is not safe as it traverses pointers
# (cdef) attribute access is not safe as it traverses pointers if self.rhs.is_attribute or not self.rhs.is_simple():
self.rhs = self.rhs.coerce_to_temp(env) if use_temp:
else: self.rhs = self.rhs.coerce_to_temp(env)
self.rhs = self.rhs.coerce_to_simple(env) else:
self.rhs = self.rhs.coerce_to_simple(env)
self.rhs = ProxyNode(self.rhs) self.rhs = ProxyNode(self.rhs)
self.coerced_rhs_list = [] self.coerced_rhs_list = []
......
...@@ -363,3 +363,27 @@ def unpack_many_int(it): ...@@ -363,3 +363,27 @@ def unpack_many_int(it):
cdef Py_ssize_t h cdef Py_ssize_t h
a,b,c,d,e,f,g,h,i,j,k,l = it a,b,c,d,e,f,g,h,i,j,k,l = it
return a,b,c,d,e,f,g,h,i,j,k,l return a,b,c,d,e,f,g,h,i,j,k,l
def unpack_literal_none_to_builtin_type():
"""
>>> unpack_literal_none_to_builtin_type()
(None, None, None, None)
"""
cdef list a,b,c,d
a, b = c, d = None, None
return a,b,c,d
cdef class ExtType:
pass
def unpack_literal_none_to_exttype():
"""
>>> unpack_literal_none_to_exttype()
(None, None, None, None)
"""
cdef ExtType a,b,c,d
a, b = c, d = None, None
return a,b,c,d
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