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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
f0fb0efa
Commit
f0fb0efa
authored
Aug 24, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cypclass refcounting during exception cleanup
parent
eebbd5d0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
36 deletions
+12
-36
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+3
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+8
-34
No files found.
Cython/Compiler/Code.py
View file @
f0fb0efa
...
...
@@ -849,10 +849,12 @@ class FunctionState(object):
elif type.is_cfunction:
from . import PyrexTypes
type = PyrexTypes.c_ptr_type(type) # A function itself isn'
t
an
l
-
value
if
not
type
.
is_pyobject
and
not
type
.
is_memoryviewslice
:
if
not
type
.
is_pyobject
and
not
type
.
is_memoryviewslice
and
not
type
.
is_cyp_class
:
# Make manage_ref canonical, so that manage_ref will always mean
# a decref is needed.
manage_ref
=
False
if
type
.
is_checked_result
:
manage_ref
=
False
freelist
=
self
.
temps_free
.
get
((
type
,
manage_ref
))
if
reusable
and
freelist
is
not
None
and
freelist
[
0
]:
...
...
Cython/Compiler/ExprNodes.py
View file @
f0fb0efa
...
...
@@ -2957,7 +2957,7 @@ class CppIteratorNode(ExprNode):
self
.
cpp_attribute_op
=
"->"
# 3) (otherwise) sequence comes from a function call or similar, so we must
# create a temp to store it in
self
.
cpp_sequence_cname
=
code
.
funcstate
.
allocate_temp
(
temp_type
,
manage_ref
=
False
)
self
.
cpp_sequence_cname
=
code
.
funcstate
.
allocate_temp
(
temp_type
,
manage_ref
=
temp_type
.
is_cyp_class
)
code
.
putln
(
"%s = %s%s;"
%
(
self
.
cpp_sequence_cname
,
"&"
if
temp_type
.
is_ptr
else
""
,
self
.
sequence
.
move_result_rhs
()))
...
...
Cython/Compiler/PyrexTypes.py
View file @
f0fb0efa
...
...
@@ -684,41 +684,15 @@ class CheckedResultType(BaseType):
def
can_coerce_from_pyobject
(
self
,
env
):
return
self
.
checked_base_type
.
can_coerce_from_pyobject
(
env
)
def
generate_incref
(
self
,
code
,
cname
,
**
kwds
):
self
.
checked_base_type
.
generate_incref
(
code
,
"%s.result"
%
cname
,
**
kwds
)
def
generate_xincref
(
self
,
code
,
cname
,
**
kwds
):
self
.
checked_base_type
.
generate_xincref
(
code
,
"%s.result"
%
cname
,
**
kwds
)
def
generate_decref
(
self
,
code
,
cname
,
**
kwds
):
self
.
checked_base_type
.
generate_decref
(
code
,
"%s.result"
%
cname
,
**
kwds
)
def
generate_decref_clear
(
self
,
code
,
cname
,
**
kwds
):
self
.
checked_base_type
.
generate_decref_clear
(
code
,
"%s.result"
%
cname
,
**
kwds
)
def
generate_xdecref
(
self
,
code
,
cname
,
**
kwds
):
self
.
checked_base_type
.
generate_xdecref
(
code
,
"%s.result"
%
cname
,
**
kwds
)
def
generate_xdecref_clear
(
self
,
code
,
cname
,
**
kwds
):
self
.
checked_base_type
.
generate_xdecref_clear
(
code
,
"%s.result"
%
cname
,
**
kwds
)
def
generate_gotref
(
self
,
code
,
cname
):
self
.
checked_base_type
.
generate_gotref
(
code
,
"%s.result"
%
cname
)
def
generate_xgotref
(
self
,
code
,
cname
):
self
.
checked_base_type
.
generate_xgotref
(
code
,
"%s.result"
%
cname
)
def
generate_giveref
(
self
,
code
,
cname
):
self
.
checked_base_type
.
generate_giveref
(
code
,
"%s.result"
%
cname
)
def
generate_xgiveref
(
self
,
code
,
cname
):
self
.
checked_base_type
.
generate_xgiveref
(
code
,
"%s.result"
%
cname
)
def
generate_decref_set
(
self
,
code
,
cname
,
rhs_cname
):
self
.
checked_base_type
.
generate_decref_set
(
code
,
"%s.result"
%
cname
,
rhs_cname
)
def
generate_dummy_refcount
(
self
,
code
,
*
args
,
**
kwargs
):
pass
def
generate_xdecref_set
(
self
,
code
,
cname
,
rhs_cname
):
self
.
checked_base_type
.
generate_xdecref_set
(
code
,
"%s.result"
%
cname
,
rhs_cname
)
generate_incref
=
generate_xincref
=
generate_dummy_refcount
generate_decref
=
generate_decref_clear
=
generate_dummy_refcount
generate_xdecref
=
generate_xdecref_clear
=
generate_dummy_refcount
generate_gotref
=
generate_xgotref
=
generate_dummy_refcount
generate_giveref
=
generate_xgiveref
=
generate_dummy_refcount
generate_decref_set
=
generate_xdecref_set
=
generate_dummy_refcount
class
MemoryViewSliceType
(
PyrexType
):
...
...
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