We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d2c4ff commit 3b6e8edCopy full SHA for 3b6e8ed
src/libcore/str/mod.rs
@@ -1497,7 +1497,7 @@ fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
1497
// Ascii case, try to skip forward quickly.
1498
// When the pointer is aligned, read 2 words of data per iteration
1499
// until we find a word containing a non-ascii byte.
1500
- if align.wrapping_sub(index) % usize_bytes == 0 {
+ if align != usize::max_value() && align.wrapping_sub(index) % usize_bytes == 0 {
1501
let ptr = v.as_ptr();
1502
while index < blocks_end {
1503
unsafe {
0 commit comments