Skip to content

Commit 3b6e8ed

Browse files
committed
Do not use pointer alignment on unsupported platforms
1 parent 3d2c4ff commit 3b6e8ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1497,7 +1497,7 @@ fn run_utf8_validation(v: &[u8]) -> Result<(), Utf8Error> {
14971497
// Ascii case, try to skip forward quickly.
14981498
// When the pointer is aligned, read 2 words of data per iteration
14991499
// until we find a word containing a non-ascii byte.
1500-
if align.wrapping_sub(index) % usize_bytes == 0 {
1500+
if align != usize::max_value() && align.wrapping_sub(index) % usize_bytes == 0 {
15011501
let ptr = v.as_ptr();
15021502
while index < blocks_end {
15031503
unsafe {

0 commit comments

Comments
 (0)