From: Raph Levien Date: Tue, 19 Apr 2016 19:52:23 +0000 (-0700) Subject: Fix wrong shift in trie_lookup_range_table X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=6923bc5fc73ce924228443c93420544e2853ed77;p=rust.git Fix wrong shift in trie_lookup_range_table Somehow got in my head that >> 8 was the right shift for a chunk of 64. Oops, sorry. --- diff --git a/src/etc/unicode.py b/src/etc/unicode.py index 406f5380d46..2b0f8d971f5 100755 --- a/src/etc/unicode.py +++ b/src/etc/unicode.py @@ -330,7 +330,7 @@ fn trie_range_leaf(c: usize, bitmap_chunk: u64) -> bool { fn trie_lookup_range_table(c: char, r: &'static BoolTrie) -> bool { let c = c as usize; if c < 0x800 { - trie_range_leaf(c, r.r1[c >> 8]) + trie_range_leaf(c, r.r1[c >> 6]) } else if c < 0x10000 { let child = r.r2[c >> 6]; trie_range_leaf(c, r.r3[child as usize]) diff --git a/src/librustc_unicode/tables.rs b/src/librustc_unicode/tables.rs index a3afa3b56ec..6c992369cd4 100644 --- a/src/librustc_unicode/tables.rs +++ b/src/librustc_unicode/tables.rs @@ -37,7 +37,7 @@ fn trie_range_leaf(c: usize, bitmap_chunk: u64) -> bool { fn trie_lookup_range_table(c: char, r: &'static BoolTrie) -> bool { let c = c as usize; if c < 0x800 { - trie_range_leaf(c, r.r1[c >> 8]) + trie_range_leaf(c, r.r1[c >> 6]) } else if c < 0x10000 { let child = r.r2[c >> 6]; trie_range_leaf(c, r.r3[child as usize])