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
8910c8c0
Commit
8910c8c0
authored
Jan 29, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More refnanny fixes
parent
92aaff74
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+3
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+1
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+6
-0
No files found.
Cython/Compiler/Code.py
View file @
8910c8c0
...
...
@@ -749,6 +749,9 @@ class CCodeWriter(object):
def
put_xgiveref
(
self
,
cname
):
self
.
putln
(
"__Pyx_XGIVEREF(%s);"
%
cname
)
def
put_xgotref
(
self
,
cname
):
self
.
putln
(
"__Pyx_XGOTREF(%s);"
%
cname
)
def
put_incref
(
self
,
cname
,
type
,
nanny
=
True
):
if
nanny
:
self
.
putln
(
"__Pyx_INCREF(%s);"
%
self
.
as_pyobject
(
cname
,
type
))
...
...
Cython/Compiler/ModuleNode.py
View file @
8910c8c0
...
...
@@ -2348,4 +2348,5 @@ int __Pyx_Refnanny_FinishContext(void*);
#define __Pyx_FinishRefcountContext() 0
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) (r ? __Pyx_GIVEREF(r) : 0)
#define __Pyx_XGOTREF(r) (r ? __Pyx_GOTREF(r) : 0)
"""
)
Cython/Compiler/Nodes.py
View file @
8910c8c0
...
...
@@ -2145,6 +2145,7 @@ class DefNode(FuncDefNode):
self
.
starstar_arg
.
entry
.
cname
,
self
.
starstar_arg
.
entry
.
cname
,
self
.
error_value
()))
code
.
put_gotref
(
self
.
starstar_arg
.
entry
.
cname
)
if
self
.
star_arg
:
self
.
star_arg
.
entry
.
xdecref_cleanup
=
0
code
.
putln
(
'if (PyTuple_GET_SIZE(%s) > %d) {'
%
(
...
...
@@ -2153,6 +2154,7 @@ class DefNode(FuncDefNode):
code
.
put
(
'%s = PyTuple_GetSlice(%s, %d, PyTuple_GET_SIZE(%s)); '
%
(
self
.
star_arg
.
entry
.
cname
,
Naming
.
args_cname
,
max_positional_args
,
Naming
.
args_cname
))
code
.
put_gotref
(
self
.
star_arg
.
entry
.
cname
)
if
self
.
starstar_arg
:
code
.
putln
(
""
)
code
.
putln
(
"if (unlikely(!%s)) {"
%
self
.
star_arg
.
entry
.
cname
)
...
...
@@ -4026,6 +4028,8 @@ class TryExceptStatNode(StatNode):
', '
.
join
([
'*%s'
%
var
for
var
in
Naming
.
exc_save_vars
]))
code
.
putln
(
"__Pyx_ExceptionSave(%s);"
%
', '
.
join
([
'&%s'
%
var
for
var
in
Naming
.
exc_save_vars
]))
for
var
in
Naming
.
exc_save_vars
:
code
.
put_xgotref
(
var
)
code
.
putln
(
"/*try:*/ {"
)
code
.
return_label
=
try_return_label
...
...
@@ -4066,12 +4070,14 @@ class TryExceptStatNode(StatNode):
if
code
.
label_used
(
except_return_label
):
code
.
put_label
(
except_return_label
)
for
var
in
Naming
.
exc_save_vars
:
code
.
put_xgiveref
(
var
)
code
.
putln
(
"__Pyx_ExceptionReset(%s);"
%
', '
.
join
(
Naming
.
exc_save_vars
))
code
.
put_goto
(
old_return_label
)
if
code
.
label_used
(
except_end_label
):
code
.
put_label
(
except_end_label
)
for
var
in
Naming
.
exc_save_vars
:
code
.
put_xgiveref
(
var
)
code
.
putln
(
"__Pyx_ExceptionReset(%s);"
%
', '
.
join
(
Naming
.
exc_save_vars
))
code
.
put_label
(
try_end_label
)
...
...
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