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
Xavier Thompson
cython
Commits
a7a448d6
Commit
a7a448d6
authored
Sep 15, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace some unsafe cypclass decrefs by xdecref
parent
4610ff37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+6
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-5
No files found.
Cython/Compiler/ExprNodes.py
View file @
a7a448d6
...
...
@@ -828,8 +828,12 @@ class ExprNode(Node):
self
.
generate_subexpr_disposal_code
(
code
)
self
.
free_subexpr_temps
(
code
)
if
self
.
result
()
and
not
self
.
has_temp_moved
:
code
.
put_decref_clear
(
self
.
result
(),
self
.
ctype
(),
have_gil
=
not
self
.
in_nogil_context
)
if
self
.
type
.
is_cyp_class
:
code
.
put_xdecref_clear
(
self
.
result
(),
self
.
ctype
(),
have_gil
=
not
self
.
in_nogil_context
)
else
:
code
.
put_decref_clear
(
self
.
result
(),
self
.
ctype
(),
have_gil
=
not
self
.
in_nogil_context
)
if
self
.
has_temp_moved
:
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"MoveIfSupported"
,
"CppSupport.cpp"
))
...
...
Cython/Compiler/Nodes.py
View file @
a7a448d6
...
...
@@ -3735,7 +3735,7 @@ class DefNodeWrapper(FuncDefNode):
# The conversion from PyObject to CyObject always creates a new CyObject reference.
# This decrements all arguments-as-variables converted straight from an actual argument.
# This includes CyObjects converted directly from a corresponding PyObject argument.
if
entry
.
xdecref_cleanup
:
if
entry
.
xdecref_cleanup
or
entry
.
type
.
is_cyp_class
:
code
.
put_var_xdecref
(
entry
)
else
:
code
.
put_var_decref
(
entry
)
...
...
@@ -3743,10 +3743,7 @@ class DefNodeWrapper(FuncDefNode):
if
entry
.
type
.
is_cyp_class
:
# The conversion from PyObject to CyObject always creates a new CyObject reference.
# This decrements CyObjects converted from generic PyObject args passed via tuple and kw dict.
if
entry
.
xdecref_cleanup
:
code
.
put_var_xdecref
(
entry
)
else
:
code
.
put_var_decref
(
entry
)
code
.
put_var_xdecref
(
entry
)
code
.
put_finish_refcount_context
()
if
not
self
.
return_type
.
is_void
:
...
...
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