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
35f59b76
Commit
35f59b76
authored
Aug 09, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix temp handling inside of EvalWithTempExprNode:
temp_expression must free its temps as early as possible
parent
7354f508
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
Cython/Compiler/UtilNodes.py
Cython/Compiler/UtilNodes.py
+13
-2
No files found.
Cython/Compiler/UtilNodes.py
View file @
35f59b76
...
@@ -186,8 +186,8 @@ class LetNodeMixin:
...
@@ -186,8 +186,8 @@ class LetNodeMixin:
def
setup_temp_expr
(
self
,
code
):
def
setup_temp_expr
(
self
,
code
):
self
.
temp_expression
.
generate_evaluation_code
(
code
)
self
.
temp_expression
.
generate_evaluation_code
(
code
)
self
.
_result_in_temp
=
self
.
temp_expression
.
result_in_temp
()
self
.
temp_type
=
self
.
temp_expression
.
type
self
.
temp_type
=
self
.
temp_expression
.
type
self
.
_result_in_temp
=
self
.
temp_expression
.
result_in_temp
()
if
self
.
_result_in_temp
:
if
self
.
_result_in_temp
:
self
.
temp
=
self
.
temp_expression
.
result
()
self
.
temp
=
self
.
temp_expression
.
result
()
else
:
else
:
...
@@ -195,10 +195,15 @@ class LetNodeMixin:
...
@@ -195,10 +195,15 @@ class LetNodeMixin:
self
.
temp
=
code
.
funcstate
.
allocate_temp
(
self
.
temp
=
code
.
funcstate
.
allocate_temp
(
self
.
temp_type
,
manage_ref
=
True
)
self
.
temp_type
,
manage_ref
=
True
)
code
.
putln
(
"%s = %s;"
%
(
self
.
temp
,
self
.
temp_expression
.
result
()))
code
.
putln
(
"%s = %s;"
%
(
self
.
temp
,
self
.
temp_expression
.
result
()))
self
.
temp_expression
.
generate_disposal_code
(
code
)
self
.
temp_expression
.
free_temps
(
code
)
self
.
lazy_temp
.
result_code
=
self
.
temp
self
.
lazy_temp
.
result_code
=
self
.
temp
def
teardown_temp_expr
(
self
,
code
):
def
teardown_temp_expr
(
self
,
code
):
if
not
self
.
_result_in_temp
:
if
self
.
_result_in_temp
:
self
.
temp_expression
.
generate_disposal_code
(
code
)
self
.
temp_expression
.
free_temps
(
code
)
else
:
if
self
.
temp_type
.
is_pyobject
:
if
self
.
temp_type
.
is_pyobject
:
code
.
put_decref_clear
(
self
.
temp
,
self
.
temp_type
)
code
.
put_decref_clear
(
self
.
temp
,
self
.
temp_type
)
code
.
funcstate
.
release_temp
(
self
.
temp
)
code
.
funcstate
.
release_temp
(
self
.
temp
)
...
@@ -227,6 +232,12 @@ class EvalWithTempExprNode(ExprNodes.ExprNode, LetNodeMixin):
...
@@ -227,6 +232,12 @@ class EvalWithTempExprNode(ExprNodes.ExprNode, LetNodeMixin):
self
.
subexpression
.
analyse_types
(
env
)
self
.
subexpression
.
analyse_types
(
env
)
self
.
type
=
self
.
subexpression
.
type
self
.
type
=
self
.
subexpression
.
type
def
free_subexpr_temps
(
self
,
code
):
self
.
subexpression
.
free_temps
(
code
)
def
generate_subexpr_disposal_code
(
self
,
code
):
self
.
subexpression
.
generate_disposal_code
(
code
)
def
generate_evaluation_code
(
self
,
code
):
def
generate_evaluation_code
(
self
,
code
):
self
.
setup_temp_expr
(
code
)
self
.
setup_temp_expr
(
code
)
self
.
subexpression
.
generate_evaluation_code
(
code
)
self
.
subexpression
.
generate_evaluation_code
(
code
)
...
...
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