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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
40370fbb
Commit
40370fbb
authored
Feb 25, 2009
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix leak in try-break.
parent
0a677a76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
Cython/Compiler/Code.py
Cython/Compiler/Code.py
+2
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+9
-0
No files found.
Cython/Compiler/Code.py
View file @
40370fbb
...
...
@@ -73,8 +73,8 @@ class FunctionState(object):
def
new_loop_labels
(
self
):
old_labels
=
self
.
get_loop_labels
()
self
.
set_loop_labels
(
(
self
.
new_label
(),
self
.
new_label
()))
(
self
.
new_label
(
"continue"
),
self
.
new_label
(
"break"
)))
return
old_labels
def
get_all_labels
(
self
):
...
...
Cython/Compiler/Nodes.py
View file @
40370fbb
...
...
@@ -4221,11 +4221,20 @@ class ExceptClauseNode(Node):
old_exc_vars
=
code
.
funcstate
.
exc_vars
code
.
funcstate
.
exc_vars
=
self
.
exc_vars
old_break_label
=
code
.
break_label
code
.
break_label
=
code
.
new_label
(
'except_break'
)
self
.
body
.
generate_execution_code
(
code
)
code
.
funcstate
.
exc_vars
=
old_exc_vars
for
var
in
self
.
exc_vars
:
code
.
putln
(
"__Pyx_DECREF(%s); %s = 0;"
%
(
var
,
var
))
code
.
put_goto
(
end_label
)
if
code
.
label_used
(
code
.
break_label
):
code
.
put_label
(
code
.
break_label
)
for
var
in
self
.
exc_vars
:
code
.
putln
(
"__Pyx_DECREF(%s); %s = 0;"
%
(
var
,
var
))
code
.
put_goto
(
old_break_label
)
code
.
break_label
=
old_break_label
code
.
putln
(
"}"
)
...
...
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