From 3b6e8ed502e351d5d8daa3ac0c61a4e44b428d98 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Fri, 5 Jul 2019 16:39:56 -0400 Subject: [PATCH 1/1] Do not use pointer alignment on unsupported platforms --- src/libcore/str/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 277dc6ff4a8..95756c27117 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1497,7 +1497,7 @@ macro_rules! next { () => {{ // Ascii case, try to skip forward quickly. // When the pointer is aligned, read 2 words of data per iteration // until we find a word containing a non-ascii byte. - if align.wrapping_sub(index) % usize_bytes == 0 { + if align != usize::max_value() && align.wrapping_sub(index) % usize_bytes == 0 { let ptr = v.as_ptr(); while index < blocks_end { unsafe { -- 2.44.0