Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
1adf6cc7
Commit
1adf6cc7
authored
Mar 24, 2016
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix reference leak in closure when reassigning to "*args" argument
parent
d42a4d7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
tests/run/closure_leak_1.pyx
tests/run/closure_leak_1.pyx
+11
-0
No files found.
Cython/Compiler/Nodes.py
View file @
1adf6cc7
...
...
@@ -1915,7 +1915,7 @@ class FuncDefNode(StatNode, BlockNode):
elif
is_cdef
and
entry
.
type
.
is_memoryviewslice
and
len
(
entry
.
cf_assignments
)
>
1
:
code
.
put_incref_memoryviewslice
(
entry
.
cname
,
have_gil
=
code
.
funcstate
.
gil_owned
)
for
entry
in
lenv
.
var_entries
:
if
entry
.
is_arg
and
len
(
entry
.
cf_assignments
)
>
1
:
if
entry
.
is_arg
and
len
(
entry
.
cf_assignments
)
>
1
and
not
entry
.
in_closure
:
if
entry
.
xdecref_cleanup
:
code
.
put_var_xincref
(
entry
)
else
:
...
...
tests/run/closure_leak_1.pyx
0 → 100644
View file @
1adf6cc7
# mode: run
# tag: closure
def
reassign_args
(
x
,
*
args
):
"""
>>> reassign_args(1, [1,2,3,4])
"""
a
,
args
=
args
[
0
],
args
[
1
:]
b
=
False
if
b
:
c
=
x
.
map_coefficients
(
lambda
c
:
c
(
*
args
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment