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
Kirill Smelkov
cython
Commits
8b27f1d8
Commit
8b27f1d8
authored
Nov 10, 2009
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix mixed declarations and code in function code generation
parent
04c2f16b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+7
-6
No files found.
Cython/Compiler/Nodes.py
View file @
8b27f1d8
...
@@ -1087,10 +1087,10 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1087,10 +1087,10 @@ class FuncDefNode(StatNode, BlockNode):
env
.
use_utility_code
(
force_init_threads_utility_code
)
env
.
use_utility_code
(
force_init_threads_utility_code
)
code
.
putln
(
"PyGILState_STATE _save = PyGILState_Ensure();"
)
code
.
putln
(
"PyGILState_STATE _save = PyGILState_Ensure();"
)
# ----- Automatic lead-ins for certain special functions
# ----- Automatic lead-ins for certain special functions
if
profile
:
code
.
put_trace_call
(
self
.
entry
.
name
,
self
.
pos
)
if
not
lenv
.
nogil
:
if
not
lenv
.
nogil
:
code
.
put_setup_refcount_context
(
self
.
entry
.
name
)
code
.
put_setup_refcount_context
(
self
.
entry
.
name
)
if
profile
:
code
.
put_trace_call
(
self
.
entry
.
name
,
self
.
pos
)
if
is_getbuffer_slot
:
if
is_getbuffer_slot
:
self
.
getbuffer_init
(
code
)
self
.
getbuffer_init
(
code
)
# ----- Fetch arguments
# ----- Fetch arguments
...
@@ -1211,18 +1211,19 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1211,18 +1211,19 @@ class FuncDefNode(StatNode, BlockNode):
if
self
.
return_type
.
is_pyobject
:
if
self
.
return_type
.
is_pyobject
:
code
.
put_xgiveref
(
self
.
return_type
.
as_pyobject
(
Naming
.
retval_cname
))
code
.
put_xgiveref
(
self
.
return_type
.
as_pyobject
(
Naming
.
retval_cname
))
code
.
put_finish_refcount_context
()
if
self
.
entry
.
is_special
and
self
.
entry
.
name
==
"__hash__"
:
if
self
.
entry
.
is_special
and
self
.
entry
.
name
==
"__hash__"
:
# Returning -1 for __hash__ is supposed to signal an error
# Returning -1 for __hash__ is supposed to signal an error
# We do as Python instances and coerce -1 into -2.
# We do as Python instances and coerce -1 into -2.
code
.
putln
(
"if (unlikely(%s == -1) && !PyErr_Occurred()) %s = -2;"
%
(
Naming
.
retval_cname
,
Naming
.
retval_cname
))
code
.
putln
(
"if (unlikely(%s == -1) && !PyErr_Occurred()) %s = -2;"
%
(
Naming
.
retval_cname
,
Naming
.
retval_cname
))
if
profile
:
if
profile
:
if
self
.
return_type
.
is_pyobject
:
if
self
.
return_type
.
is_pyobject
:
code
.
put_trace_return
(
Naming
.
retval_cname
)
code
.
put_trace_return
(
Naming
.
retval_cname
)
else
:
else
:
code
.
put_trace_return
(
"Py_None"
)
code
.
put_trace_return
(
"Py_None"
)
if
not
lenv
.
nogil
:
code
.
put_finish_refcount_context
()
if
acquire_gil
:
if
acquire_gil
:
code
.
putln
(
"PyGILState_Release(_save);"
)
code
.
putln
(
"PyGILState_Release(_save);"
)
...
@@ -5042,7 +5043,7 @@ raise_error:
...
@@ -5042,7 +5043,7 @@ raise_error:
return;
return;
}
}
#else /
/ Python 3+
#else /
* Python 3+ */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
if (tb == Py_None) {
if (tb == Py_None) {
...
...
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