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
7559edf1
Commit
7559edf1
authored
Sep 11, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some error tests for c array iteration.
parent
082aee71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+1
-1
tests/errors/e_slice.pyx
tests/errors/e_slice.pyx
+21
-7
No files found.
Cython/Compiler/Optimize.py
View file @
7559edf1
...
@@ -306,7 +306,7 @@ class IterationTransform(Visitor.VisitorTransform):
...
@@ -306,7 +306,7 @@ class IterationTransform(Visitor.VisitorTransform):
else
:
else
:
if
not
slice_node
.
type
.
is_pyobject
:
if
not
slice_node
.
type
.
is_pyobject
:
error
(
slice_node
.
pos
,
"
Invalid C array iteration
"
)
error
(
slice_node
.
pos
,
"
C array iteration requires known end index
"
)
return
node
return
node
if
start
:
if
start
:
...
...
tests/errors/e_slice.pyx
View file @
7559edf1
def
f
(
obj2
):
def
f
(
obj2
):
cdef
int
*
ptr1
cdef
int
*
ptr1
obj1
=
obj2
[
ptr1
::]
# error
obj1
=
obj2
[
ptr1
::]
# error
obj1
=
obj2
[:
ptr1
:]
# error
obj1
=
obj2
[:
ptr1
:]
# error
obj1
=
obj2
[::
ptr1
]
# error
obj1
=
obj2
[::
ptr1
]
# error
cdef
int
a
cdef
int
*
int_ptr
for
a
in
int_ptr
:
pass
for
a
in
int_ptr
[
2
:]:
pass
for
a
in
int_ptr
[
2
:
2
:
a
]:
pass
_ERRORS
=
u"""
_ERRORS
=
u"""
3:17: Cannot convert 'int *' to Python object
3:20: Cannot convert 'int *' to Python object
4:18: Cannot convert 'int *' to Python object
4:21: Cannot convert 'int *' to Python object
5:19: Cannot convert 'int *' to Python object
5:22: Cannot convert 'int *' to Python object
10:16: C array iteration requires known end index
12:16: C array iteration requires known end index
14:22: C array iteration requires known step size and end index
"""
"""
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