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
59d44445
Commit
59d44445
authored
Sep 09, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compiler crash in type inference if we cannot determine the type of the indexing offset
parent
d4b42be1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+3
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
59d44445
...
@@ -1960,7 +1960,8 @@ class IndexNode(ExprNode):
...
@@ -1960,7 +1960,8 @@ class IndexNode(ExprNode):
# any better than this:
# any better than this:
return
py_object_type
return
py_object_type
if
self
.
index
.
infer_type
(
env
).
is_int
or
isinstance
(
self
.
index
,
(
IntNode
,
LongNode
)):
index_type
=
self
.
index
.
infer_type
(
env
)
if
index_type
and
index_type
.
is_int
or
isinstance
(
self
.
index
,
(
IntNode
,
LongNode
)):
# indexing!
# indexing!
if
base_type
is
unicode_type
:
if
base_type
is
unicode_type
:
# Py_UNICODE will automatically coerce to a unicode string
# Py_UNICODE will automatically coerce to a unicode string
...
@@ -1973,6 +1974,7 @@ class IndexNode(ExprNode):
...
@@ -1973,6 +1974,7 @@ class IndexNode(ExprNode):
return
PyrexTypes
.
c_py_unicode_type
return
PyrexTypes
.
c_py_unicode_type
elif
base_type
.
is_ptr
or
base_type
.
is_array
:
elif
base_type
.
is_ptr
or
base_type
.
is_array
:
return
base_type
.
base_type
return
base_type
.
base_type
if
base_type
is
unicode_type
:
if
base_type
is
unicode_type
:
# this type always returns its own type on Python indexing/slicing
# this type always returns its own type on Python indexing/slicing
return
base_type
return
base_type
...
...
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