From a17ab0620902107116e33a2fc926c399c76ec264 Mon Sep 17 00:00:00 2001 From: Yoshiki Takashima Date: Sun, 23 Aug 2020 10:19:27 -0400 Subject: [PATCH] Fixed UB flagged by Miri. --- src/ascii.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ascii.rs b/src/ascii.rs index 6ba6daf4..19d980ca 100644 --- a/src/ascii.rs +++ b/src/ascii.rs @@ -211,7 +211,7 @@ macro_rules! basic_latin_alu { let src_until_alignment = (ALU_ALIGNMENT - ((src as usize) & ALU_ALIGNMENT_MASK)) & ALU_ALIGNMENT_MASK; - if (dst.add(src_until_alignment) as usize) & ALU_ALIGNMENT_MASK != 0 { + if (dst.wrapping_add(src_until_alignment) as usize) & ALU_ALIGNMENT_MASK != 0 { break; } src_until_alignment