Commit 73df006f authored by Stefan Behnel's avatar Stefan Behnel

fix control flow analysis for del-ing non-names

parent e4ed640a
......@@ -838,6 +838,8 @@ class ControlFlowAnalysis(CythonTransform):
# Mark reference
self._visit(arg)
self.flow.mark_deletion(arg, entry)
else:
self._visit(arg)
return node
def visit_CArgDeclNode(self, node):
......
cimport cython
class A(object):
"""
>>> a = A()
......@@ -27,6 +29,7 @@ def del_item(L, o):
del L[o]
return L
@cython.test_assert_path_exists('//NoneCheckNode')
def del_dict(dict D, o):
"""
>>> del_dict({1: 'a', 2: 'b'}, 1)
......@@ -35,6 +38,16 @@ def del_dict(dict D, o):
del D[o]
return D
@cython.test_fail_if_path_exists('//NoneCheckNode')
def del_dict_from_literal(o):
"""
>>> del_dict_from_literal(1)
{2: 'b'}
"""
D = {1: 'a', 2: 'b'}
del D[o]
return D
def del_list(list L, o):
"""
>>> del_list(list(range(5)), 3)
......
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