projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38cf883
)
off-by-one fix
author
Stefan Behnel
<scoder@users.berlios.de>
Fri, 14 Nov 2008 20:00:50 +0000
(21:00 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Fri, 14 Nov 2008 20:00:50 +0000
(21:00 +0100)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index 3d15ca9036a1121d514cf759a58a026f0dc50302..3f0ff191014bb76f7ef731215e7ad0f149b696df 100644
(file)
--- a/
Cython/Compiler/ExprNodes.py
+++ b/
Cython/Compiler/ExprNodes.py
@@
-1828,7
+1828,6
@@
class SliceIndexNode(ExprNode):
else:
start_offset += '+'
if rhs.type.is_array:
- # FIXME: we should check both array sizes here
array_length = rhs.type.size
self.generate_slice_guard_code(code, array_length)
else:
@@
-1863,10
+1862,10
@@
class SliceIndexNode(ExprNode):
stop = self.stop.result()
try:
stop = int(stop)
- if stop > 0:
- slice_size = stop
- else:
+ if stop < 0:
slice_size = self.base.type.size + stop
+ else:
+ slice_size = stop
stop = None
except ValueError:
pass