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
Boxiang Sun
cython
Commits
0a33f1e6
Commit
0a33f1e6
authored
Dec 04, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compiler crashes on unknown functions
parent
7c5d73af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+4
-2
No files found.
Cython/Compiler/Optimize.py
View file @
0a33f1e6
...
...
@@ -118,7 +118,7 @@ class IterationTransform(Visitor.VisitorTransform):
# enumerate() ?
if
iterator
.
self
is
None
and
\
isinstance
(
function
,
ExprNodes
.
NameNode
)
and
\
function
.
entry
.
is_builtin
and
\
function
.
entry
and
function
.
entry
.
is_builtin
and
\
function
.
name
==
'enumerate'
:
return
self
.
_transform_enumerate_iteration
(
node
,
iterator
)
...
...
@@ -126,7 +126,7 @@ class IterationTransform(Visitor.VisitorTransform):
if
Options
.
convert_range
and
node
.
target
.
type
.
is_int
:
if
iterator
.
self
is
None
and
\
isinstance
(
function
,
ExprNodes
.
NameNode
)
and
\
function
.
entry
.
is_builtin
and
\
function
.
entry
and
function
.
entry
.
is_builtin
and
\
function
.
name
in
(
'range'
,
'xrange'
):
return
self
.
_transform_range_iteration
(
node
,
iterator
)
...
...
@@ -831,6 +831,8 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
# we only consider functions that are either builtin
# Python functions or builtins that were already replaced
# 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
if
not
is_builtin
:
...
...
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