mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fix overflow of string reverse iteration
This issue does not appear in CI.
This commit is contained in:
1 parent
0eba3ba80b
commit
3e3bd07ff8
1 file changed
+5
-1
@@ -180,7 +180,11 @@ impl PyIter for PyStrReverseIterator {
|
||||
break;
|
||||
}
|
||||
}
|
||||
start.unwrap_or(end - 4)
|
||||
if end < 4 {
|
||||
start.unwrap_or(0)
|
||||
} else {
|
||||
start.unwrap_or(end - 4)
|
||||
}
|
||||
};
|
||||
|
||||
let stored = zelf.position.swap(start);
|
||||
|
||||
Reference in new issue
Block a user