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
fddf37ed
Commit
fddf37ed
authored
Apr 27, 2011
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compiler crash in FlattenInListTransform for non-trivial expressions
parent
7dd89787
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+9
-1
tests/run/flatin.pyx
tests/run/flatin.pyx
+1
-1
No files found.
Cython/Compiler/Optimize.py
View file @
fddf37ed
...
...
@@ -930,7 +930,15 @@ class FlattenInListTransform(Visitor.VisitorTransform, SkipDeclarations):
conds
=
[]
temps
=
[]
for
arg
in
args
:
if
not
arg
.
is_simple
():
try
:
# Trial optimisation to avoid redundant temp
# assignments. However, since is_simple() is meant to
# be called after type analysis, we ignore any errors
# and just play safe in that case.
is_simple_arg
=
arg
.
is_simple
()
except
Exception
:
is_simple_arg
=
False
if
not
is_simple_arg
:
# must evaluate all non-simple RHS before doing the comparisons
arg
=
UtilNodes
.
LetRefNode
(
arg
)
temps
.
append
(
arg
)
...
...
tests/run/flatin.pyx
View file @
fddf37ed
...
...
@@ -13,7 +13,7 @@ def test_in(s):
>>> test_in('')
5
"""
if
s
in
(
u'ABC'
,
u'BCD'
):
if
s
in
(
u'ABC'
,
u'BCD'
,
u'ABC'
[:
3
],
u'ABC'
[::
-
1
],
u'ABC'
[
-
1
]
):
return
1
elif
s
.
upper
()
in
(
u'ABC'
,
u'BCD'
):
return
2
...
...
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