]> git.lizzy.rs Git - rust.git/commitdiff
Fix wrong shift in trie_lookup_range_table
authorRaph Levien <raph@google.com>
Tue, 19 Apr 2016 19:52:23 +0000 (12:52 -0700)
committerRaph Levien <raph@google.com>
Tue, 19 Apr 2016 19:52:23 +0000 (12:52 -0700)
Somehow got in my head that >> 8 was the right shift for a chunk of 64.
Oops, sorry.

src/etc/unicode.py
src/librustc_unicode/tables.rs

index 406f5380d4693625b9b6975ead0a3200212d3a71..2b0f8d971f5187fd6cd35a9cac757d6fb533641e 100755 (executable)
@@ -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])
index a3afa3b56ec9edd8606b03d0cefb1905da453055..6c992369cd45dab01bf2841bbbdaaf9b21db9998 100644 (file)
@@ -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])