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
Boxiang Sun
cython
Commits
cc1c499b
Commit
cc1c499b
authored
Aug 31, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bare return for closure creation failure.
Re-use, rather than duplicate, error exit code.
parent
09f6874a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
21 deletions
+8
-21
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+8
-21
No files found.
Cython/Compiler/Nodes.py
View file @
cc1c499b
...
...
@@ -1848,28 +1848,15 @@ class FuncDefNode(StatNode, BlockNode):
lenv
.
scope_class
.
type
.
typeptr_cname
,
Naming
.
empty_tuple
))
code
.
putln
(
"if (unlikely(!%s)) {"
%
Naming
.
cur_scope_cname
)
if
is_getbuffer_slot
:
self
.
getbuffer_error_cleanup
(
code
)
if
use_refnanny
:
code
.
put_finish_refcount_context
()
if
acquire_gil
or
acquire_gil_for_var_decls_only
:
code
.
put_release_ensured_gil
()
# FIXME: what if the error return value is a Python value?
err_val
=
self
.
error_value
()
if
err_val
is
None
:
if
not
self
.
caller_will_check_exceptions
():
warning
(
self
.
entry
.
pos
,
"Unraisable exception in function '%s'."
%
self
.
entry
.
qualified_name
,
0
)
code
.
put_unraisable
(
self
.
entry
.
qualified_name
,
lenv
.
nogil
)
#if self.return_type.is_void:
code
.
putln
(
"return;"
)
else
:
code
.
putln
(
"return %s;"
%
err_val
)
code
.
putln
(
"}"
)
# Scope unconditionally DECREFed on return.
code
.
putln
(
"%s = %s;"
%
(
Naming
.
cur_scope_cname
,
lenv
.
scope_class
.
type
.
cast_code
(
"Py_None"
)));
code
.
put_incref
(
"Py_None"
,
py_object_type
);
code
.
putln
(
code
.
error_goto
(
self
.
pos
))
code
.
putln
(
"} else {"
)
code
.
put_gotref
(
Naming
.
cur_scope_cname
)
code
.
putln
(
"}"
)
# Note that it is unsafe to decref the scope at this point.
if
self
.
needs_outer_scope
:
if
self
.
is_cyfunction
:
...
...
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