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):
from ExprNodes import CloneNode, ProxyNode
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
self.rhs = self.rhs.coerce_to_temp(env)
else:
self.rhs = self.rhs.coerce_to_simple(env)
# (cdef) attribute access is not safe as it traverses pointers
if self.rhs.is_attribute or not self.rhs.is_simple():
if use_temp:
self.rhs = self.rhs.coerce_to_temp(env)
else:
self.rhs = self.rhs.coerce_to_simple(env)
self.rhs = ProxyNode(self.rhs)
self.coerced_rhs_list = []
......
......@@ -363,3 +363,27 @@ def unpack_many_int(it):
cdef Py_ssize_t h
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
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