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
729310a8
Commit
729310a8
authored
Dec 14, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix C compiler warning about unused variable
parent
3f8cf084
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+13
-7
No files found.
Cython/Compiler/Nodes.py
View file @
729310a8
...
...
@@ -6392,15 +6392,18 @@ class TryFinallyStatNode(StatNode):
finally_clause
=
copy
.
deepcopy
(
self
.
finally_clause
)
preserve_error
=
self
.
preserve_exception
and
code
.
label_used
(
new_error_label
)
needs_success_cleanup
=
not
finally_clause
.
is_terminator
if
preserve_error
:
if
self
.
is_try_finally_in_nogil
:
code
.
declare_gilstate
()
code
.
putln
(
"PyObject *%s, *%s, *%s;"
%
Naming
.
exc_vars
)
code
.
putln
(
"int %s;"
%
Naming
.
exc_lineno_name
)
if
needs_success_cleanup
:
code
.
putln
(
"int %s;"
%
Naming
.
exc_lineno_name
)
exc_var_init_zero
=
''
.
join
(
[
"%s = 0; "
%
var
for
var
in
Naming
.
exc_vars
])
exc_var_init_zero
+=
'%s = 0;'
%
Naming
.
exc_lineno_name
if
needs_success_cleanup
:
exc_var_init_zero
+=
'%s = 0;'
%
Naming
.
exc_lineno_name
else
:
exc_var_init_zero
=
None
...
...
@@ -6409,21 +6412,23 @@ class TryFinallyStatNode(StatNode):
if
exc_var_init_zero
:
code
.
putln
(
exc_var_init_zero
)
self
.
finally_clause
.
generate_execution_code
(
code
)
code
.
put_goto
(
catch_label
)
if
not
finally_clause
.
is_terminator
:
code
.
put_goto
(
catch_label
)
code
.
putln
(
'}'
)
if
preserve_error
:
code
.
putln
(
'/*exception exit:*/{'
)
code
.
put
(
'%s: '
%
new_error_label
)
code
.
putln
(
exc_var_init_zero
)
self
.
put_error_catcher
(
code
,
temps_to_clean_up
)
self
.
put_error_catcher
(
code
,
temps_to_clean_up
,
include_lineno
=
needs_success_cleanup
)
finally_old_labels
=
code
.
all_new_labels
()
code
.
putln
(
'{'
)
copy
.
deepcopy
(
finally_clause
).
generate_execution_code
(
code
)
code
.
putln
(
'}'
)
if
n
ot
finally_clause
.
is_terminator
:
if
n
eeds_success_cleanup
:
self
.
put_error_uncatcher
(
code
)
code
.
put_goto
(
old_error_label
)
...
...
@@ -6460,7 +6465,7 @@ class TryFinallyStatNode(StatNode):
self
.
body
.
generate_function_definitions
(
env
,
code
)
self
.
finally_clause
.
generate_function_definitions
(
env
,
code
)
def
put_error_catcher
(
self
,
code
,
temps_to_clean_up
):
def
put_error_catcher
(
self
,
code
,
temps_to_clean_up
,
include_lineno
):
code
.
globalstate
.
use_utility_code
(
restore_exception_utility_code
)
if
self
.
is_try_finally_in_nogil
:
...
...
@@ -6470,7 +6475,8 @@ class TryFinallyStatNode(StatNode):
code
.
put_xdecref_clear
(
temp_name
,
type
)
code
.
putln
(
"__Pyx_ErrFetch(&%s, &%s, &%s);"
%
Naming
.
exc_vars
)
code
.
putln
(
"%s = %s;"
%
(
Naming
.
exc_lineno_name
,
Naming
.
lineno_cname
))
if
include_lineno
:
code
.
putln
(
"%s = %s;"
%
(
Naming
.
exc_lineno_name
,
Naming
.
lineno_cname
))
if
self
.
is_try_finally_in_nogil
:
code
.
put_release_ensured_gil
()
...
...
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