]> Cypherpunks repositories - gostls13.git/commit
exp/locale/collate: fixed two bugs uncovered by regression tests.
authorMarcel van Lohuizen <mpvl@golang.org>
Wed, 2 May 2012 15:01:41 +0000 (17:01 +0200)
committerMarcel van Lohuizen <mpvl@golang.org>
Wed, 2 May 2012 15:01:41 +0000 (17:01 +0200)
commit10838165d8249175020155751469bc7729d78fb9
treef9dd97c52d3def0d3a4eddbd908a3c7df853aeb5
parent81d9621534ac726ff613e54e98844ee43398250c
exp/locale/collate: fixed two bugs uncovered by regression tests.
The first bug was that tertiary ignorables had the same colElem as
implicit colElems, yielding unexpected results. The current encoding
ensures that a non-implicit colElem is never 0.  This fix uncovered
another bug of the trie that indexed incorrectly into the null block.
This was caused by an unfinished optimization that would avoid the
need to max out the most-significant bits of continuation bytes.
This bug was also present in the trie used in exp/norm and has been
fixed there as well. The appearence of the bug was rare, as the lower
blocks happened to be nearly nil.

R=r
CC=golang-dev
https://golang.org/cl/6127070
13 files changed:
src/pkg/exp/locale/collate/build/colelem.go
src/pkg/exp/locale/collate/build/colelem_test.go
src/pkg/exp/locale/collate/build/trie.go
src/pkg/exp/locale/collate/build/trie_test.go
src/pkg/exp/locale/collate/colelem.go
src/pkg/exp/locale/collate/colelem_test.go
src/pkg/exp/locale/collate/trie.go
src/pkg/exp/locale/collate/trie_test.go
src/pkg/exp/norm/tables.go
src/pkg/exp/norm/trie.go
src/pkg/exp/norm/trie_test.go
src/pkg/exp/norm/triedata_test.go
src/pkg/exp/norm/triegen.go