Commit 0f8114cf authored by Kevin Modzelewski's avatar Kevin Modzelewski

Fix strSlice assertion

Signed-unsigned comparison giving bad results for the comparison.  Should probably
turn -Wsign-compare back on.
parent 70f71677
......@@ -1652,9 +1652,9 @@ Box* _strSlice(BoxedString* self, i64 start, i64 stop, i64 step, i64 length) {
assert(step != 0);
if (step > 0) {
assert(0 <= start);
assert(stop <= s.size());
assert(stop <= (i64)s.size());
} else {
assert(start < s.size());
assert(start < (i64)s.size());
assert(-1 <= stop);
}
assert(length >= 0);
......
......@@ -181,3 +181,10 @@ def irgen_error():
fail = "test {0} {1} {2}".format(1, 2, 3)
print fail
irgen_error()
s = "hello"
for i in xrange(-8, 8):
for j in xrange(-8, 8):
print i,j, repr(s[i:j])
for k in (-2, 1, 1, 2):
print i,j,k, repr(s[i:j:k]), repr(s[slice(i, j, k)])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment