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
7039048b
Commit
7039048b
authored
Jan 28, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a method's self argument doesn't need to be in a temp when calling it
parent
ff8480f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+9
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
7039048b
...
...
@@ -2965,7 +2965,10 @@ class SimpleCallNode(CallNode):
if
arg
.
is_temp
:
some_args_in_temps
=
True
elif
arg
.
type
.
is_pyobject
and
not
env
.
nogil
:
if
not
arg
.
is_name
or
arg
.
entry
and
(
not
arg
.
entry
.
is_local
or
arg
.
entry
.
in_closure
):
if
arg
.
is_name
or
(
i
==
0
and
self
.
self
is
not
None
):
# names and a method's cloned "self" argument are ok
pass
elif
arg
.
entry
and
(
not
arg
.
entry
.
is_local
or
arg
.
entry
.
in_closure
):
# we do not safely own the argument's reference,
# but we must make sure it cannot be collected
# before we return from the function, so we create
...
...
@@ -2978,6 +2981,8 @@ class SimpleCallNode(CallNode):
# constructed in the wrong order (temps first) => make
# sure they are either all temps or all not temps
for
i
in
range
(
min
(
max_nargs
,
actual_nargs
)
-
1
):
if
i
==
0
and
self
.
self
is
not
None
:
continue
# self is ok
arg
=
self
.
args
[
i
]
if
arg
.
is_name
and
arg
.
entry
and
(
(
arg
.
entry
.
is_local
and
not
arg
.
entry
.
in_closure
)
...
...
@@ -7404,6 +7409,9 @@ class CloneNode(CoercionNode):
if
hasattr
(
self
.
arg
,
'entry'
):
self
.
entry
=
self
.
arg
.
entry
def
is_simple
(
self
):
return
True
# result is always in a temp (or a name)
def
generate_evaluation_code
(
self
,
code
):
pass
...
...
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