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
62340238
Commit
62340238
authored
Dec 13, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix assignments to closure variables
parent
b59160e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+7
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
62340238
...
@@ -1618,7 +1618,8 @@ class NameNode(AtomicExprNode):
...
@@ -1618,7 +1618,8 @@ class NameNode(AtomicExprNode):
#print "...RHS type", rhs.type, "ctype", rhs.ctype() ###
#print "...RHS type", rhs.type, "ctype", rhs.ctype() ###
if
self
.
use_managed_ref
:
if
self
.
use_managed_ref
:
rhs
.
make_owned_reference
(
code
)
rhs
.
make_owned_reference
(
code
)
if
entry
.
is_cglobal
:
is_external_ref
=
entry
.
is_cglobal
or
self
.
entry
.
in_closure
or
self
.
entry
.
from_closure
if
is_external_ref
:
code
.
put_gotref
(
self
.
py_result
())
code
.
put_gotref
(
self
.
py_result
())
if
not
self
.
lhs_of_first_assignment
:
if
not
self
.
lhs_of_first_assignment
:
if
entry
.
is_local
and
not
Options
.
init_local_none
:
if
entry
.
is_local
and
not
Options
.
init_local_none
:
...
@@ -1629,7 +1630,7 @@ class NameNode(AtomicExprNode):
...
@@ -1629,7 +1630,7 @@ class NameNode(AtomicExprNode):
code
.
put_xdecref
(
self
.
result
(),
self
.
ctype
())
code
.
put_xdecref
(
self
.
result
(),
self
.
ctype
())
else
:
else
:
code
.
put_decref
(
self
.
result
(),
self
.
ctype
())
code
.
put_decref
(
self
.
result
(),
self
.
ctype
())
if
entry
.
is_cglobal
:
if
is_external_ref
:
code
.
put_giveref
(
rhs
.
py_result
())
code
.
put_giveref
(
rhs
.
py_result
())
code
.
putln
(
'%s = %s;'
%
(
self
.
result
(),
code
.
putln
(
'%s = %s;'
%
(
self
.
result
(),
...
@@ -5010,9 +5011,10 @@ class YieldExprNode(ExprNode):
...
@@ -5010,9 +5011,10 @@ class YieldExprNode(ExprNode):
for
cname
,
type
,
manage_ref
in
code
.
funcstate
.
temps_in_use
():
for
cname
,
type
,
manage_ref
in
code
.
funcstate
.
temps_in_use
():
save_cname
=
code
.
temp_allocator
.
allocate_temp
(
type
)
save_cname
=
code
.
temp_allocator
.
allocate_temp
(
type
)
saved
.
append
((
cname
,
save_cname
,
type
))
saved
.
append
((
cname
,
save_cname
,
type
))
if
type
.
is_pyobject
:
code
.
put_xgiveref
(
cname
)
code
.
putln
(
'%s->%s = %s;'
%
(
Naming
.
cur_scope_cname
,
save_cname
,
cname
))
code
.
putln
(
'%s->%s = %s;'
%
(
Naming
.
cur_scope_cname
,
save_cname
,
cname
))
code
.
temp_allocator
.
put_giveref
(
code
)
code
.
put_xgiveref
(
Naming
.
retval_cname
)
code
.
put_xgiveref
(
Naming
.
retval_cname
)
code
.
put_finish_refcount_context
()
code
.
put_finish_refcount_context
()
code
.
putln
(
"/* return from function, yielding value */"
)
code
.
putln
(
"/* return from function, yielding value */"
)
...
@@ -5024,6 +5026,8 @@ class YieldExprNode(ExprNode):
...
@@ -5024,6 +5026,8 @@ class YieldExprNode(ExprNode):
code
.
putln
(
'%s = %s->%s;'
%
(
cname
,
Naming
.
cur_scope_cname
,
save_cname
))
code
.
putln
(
'%s = %s->%s;'
%
(
cname
,
Naming
.
cur_scope_cname
,
save_cname
))
if
type
.
is_pyobject
:
if
type
.
is_pyobject
:
code
.
putln
(
'%s->%s = 0;'
%
(
Naming
.
cur_scope_cname
,
save_cname
))
code
.
putln
(
'%s->%s = 0;'
%
(
Naming
.
cur_scope_cname
,
save_cname
))
if
type
.
is_pyobject
:
code
.
put_xgotref
(
cname
)
if
self
.
result_is_used
:
if
self
.
result_is_used
:
self
.
allocate_temp_result
(
code
)
self
.
allocate_temp_result
(
code
)
code
.
putln
(
'%s = %s; %s'
%
code
.
putln
(
'%s = %s; %s'
%
...
...
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