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
Kirill Smelkov
cython
Commits
cdd7a878
Commit
cdd7a878
authored
Dec 16, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
safer way to check for builtins in Optimize.py
parent
43bdaf62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+5
-4
No files found.
Cython/Compiler/Optimize.py
View file @
cdd7a878
...
...
@@ -1110,8 +1110,9 @@ class EarlyReplaceBuiltinCalls(Visitor.EnvTransform):
def
_function_is_builtin_name
(
self
,
function
):
if
not
function
.
is_name
:
return
False
entry
=
self
.
current_env
().
lookup
(
function
.
name
)
if
entry
and
getattr
(
entry
,
'scope'
,
None
)
is
not
Builtin
.
builtin_scope
:
env
=
self
.
current_env
()
entry
=
env
.
lookup
(
function
.
name
)
if
entry
is
not
env
.
builtin_scope
().
lookup_here
(
function
.
name
):
return
False
# if entry is None, it's at least an undeclared name, so likely builtin
return
True
...
...
@@ -1724,8 +1725,8 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
# into a C function call (defined in the builtin scope)
if
not
function
.
entry
:
return
node
is_builtin
=
function
.
entry
.
is_builtin
\
or
getattr
(
function
.
entry
,
'scope'
,
None
)
is
Builtin
.
builtin_scope
is_builtin
=
function
.
entry
.
is_builtin
or
\
function
.
entry
is
self
.
current_env
().
builtin_scope
().
lookup_here
(
function
.
name
)
if
not
is_builtin
:
return
node
function_handler
=
self
.
_find_handler
(
...
...
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