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
f3684727
Commit
f3684727
authored
Jul 28, 2014
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid generating dead temp cleanup code after try blocks that return/break/continue at the end
parent
150d9bab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+9
-5
No files found.
Cython/Compiler/Nodes.py
View file @
f3684727
...
@@ -6322,17 +6322,21 @@ class TryExceptStatNode(StatNode):
...
@@ -6322,17 +6322,21 @@ class TryExceptStatNode(StatNode):
code
.
error_label
=
except_error_label
code
.
error_label
=
except_error_label
code
.
return_label
=
except_return_label
code
.
return_label
=
except_return_label
normal_case_terminates
=
self
.
body
.
is_terminator
if
self
.
else_clause
:
if
self
.
else_clause
:
code
.
putln
(
code
.
putln
(
"/*else:*/ {"
)
"/*else:*/ {"
)
self
.
else_clause
.
generate_execution_code
(
code
)
self
.
else_clause
.
generate_execution_code
(
code
)
code
.
putln
(
code
.
putln
(
"}"
)
"}"
)
if
not
normal_case_terminates
:
normal_case_terminates
=
self
.
else_clause
.
is_terminator
if
can_raise
:
if
can_raise
:
for
var
in
exc_save_vars
:
if
not
normal_case_terminates
:
code
.
put_xdecref_clear
(
var
,
py_object_type
)
for
var
in
exc_save_vars
:
code
.
put_goto
(
try_end_label
)
code
.
put_xdecref_clear
(
var
,
py_object_type
)
code
.
put_goto
(
try_end_label
)
code
.
put_label
(
our_error_label
)
code
.
put_label
(
our_error_label
)
for
temp_name
,
temp_type
in
temps_to_clean_up
:
for
temp_name
,
temp_type
in
temps_to_clean_up
:
code
.
put_xdecref_clear
(
temp_name
,
temp_type
)
code
.
put_xdecref_clear
(
temp_name
,
temp_type
)
...
@@ -6347,14 +6351,14 @@ class TryExceptStatNode(StatNode):
...
@@ -6347,14 +6351,14 @@ class TryExceptStatNode(StatNode):
(
try_return_label
,
old_return_label
),
(
try_return_label
,
old_return_label
),
(
except_return_label
,
old_return_label
)]:
(
except_return_label
,
old_return_label
)]:
if
code
.
label_used
(
exit_label
):
if
code
.
label_used
(
exit_label
):
if
not
code
.
label_used
(
try_end_label
):
if
not
normal_case_terminates
and
not
code
.
label_used
(
try_end_label
):
code
.
put_goto
(
try_end_label
)
code
.
put_goto
(
try_end_label
)
code
.
put_label
(
exit_label
)
code
.
put_label
(
exit_label
)
restore_saved_exception
()
restore_saved_exception
()
code
.
put_goto
(
old_label
)
code
.
put_goto
(
old_label
)
if
code
.
label_used
(
except_end_label
):
if
code
.
label_used
(
except_end_label
):
if
not
code
.
label_used
(
try_end_label
):
if
not
normal_case_terminates
and
not
code
.
label_used
(
try_end_label
):
code
.
put_goto
(
try_end_label
)
code
.
put_goto
(
try_end_label
)
code
.
put_label
(
except_end_label
)
code
.
put_label
(
except_end_label
)
restore_saved_exception
()
restore_saved_exception
()
...
...
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