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
456458ab
Commit
456458ab
authored
Jun 07, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another large integer literal fix (indexing).
parent
0e032cc2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-0
tests/run/index.pyx
tests/run/index.pyx
+2
-1
No files found.
Cython/Compiler/ExprNodes.py
View file @
456458ab
...
@@ -18,6 +18,7 @@ from Builtin import list_type, tuple_type, set_type, dict_type, \
...
@@ -18,6 +18,7 @@ from Builtin import list_type, tuple_type, set_type, dict_type, \
import
Builtin
import
Builtin
import
Symtab
import
Symtab
import
Options
import
Options
from
Cython
import
Utils
from
Annotate
import
AnnotationItem
from
Annotate
import
AnnotationItem
from
Cython.Debugging
import
print_call_chain
from
Cython.Debugging
import
print_call_chain
...
@@ -1945,6 +1946,9 @@ class IndexNode(ExprNode):
...
@@ -1945,6 +1946,9 @@ class IndexNode(ExprNode):
self
.
type
=
PyrexTypes
.
error_type
self
.
type
=
PyrexTypes
.
error_type
return
return
if
isinstance
(
self
.
index
,
IntNode
)
and
Utils
.
long_literal
(
self
.
index
.
value
):
self
.
index
=
self
.
index
.
coerce_to_pyobject
(
env
)
# Handle the case where base is a literal char* (and we expect a string, not an int)
# Handle the case where base is a literal char* (and we expect a string, not an int)
if
isinstance
(
self
.
base
,
BytesNode
):
if
isinstance
(
self
.
base
,
BytesNode
):
self
.
base
=
self
.
base
.
coerce_to_pyobject
(
env
)
self
.
base
=
self
.
base
.
coerce_to_pyobject
(
env
)
...
...
tests/run/index.pyx
View file @
456458ab
...
@@ -129,6 +129,7 @@ def test_boundscheck(list L, tuple t, object o, unsigned long ix):
...
@@ -129,6 +129,7 @@ def test_boundscheck(list L, tuple t, object o, unsigned long ix):
def
large_literal_index
(
object
o
):
def
large_literal_index
(
object
o
):
"""
"""
>>> large_literal_index({1000000000000000000000000000000: "yes"})
>>> large_literal_index({1000000000000000000000000000000: True})
True
"""
"""
return
o
[
1000000000000000000000000000000
]
return
o
[
1000000000000000000000000000000
]
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