Skip to content

Commit 08a1a7e

Browse files
YoshikiTakashimahsivonen
authored andcommitted
Fixed UB flagged by Miri.
1 parent 8e3eee5 commit 08a1a7e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ascii.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ macro_rules! basic_latin_alu {
211211
let src_until_alignment = (ALU_ALIGNMENT
212212
- ((src as usize) & ALU_ALIGNMENT_MASK))
213213
& ALU_ALIGNMENT_MASK;
214-
if (dst.add(src_until_alignment) as usize) & ALU_ALIGNMENT_MASK != 0 {
214+
if (dst.wrapping_add(src_until_alignment) as usize) & ALU_ALIGNMENT_MASK != 0 {
215215
break;
216216
}
217217
src_until_alignment

0 commit comments

Comments
 (0)