diff options
author | 2012-01-13 04:02:47 -0800 | |
---|---|---|
committer | 2012-01-13 04:02:47 -0800 | |
commit | a3e52e94fb4f37f00a647f1b1de5424ab597907a (patch) | |
tree | b1b1b8a5398e8af60c95c16634390ba1393a2d1f | |
parent | 4cabb049718003341edc75be23fbd87a7eea9cc6 (diff) | |
parent | 512c669fee6aa90dbfb3e00a1be7730eb807c9a0 (diff) | |
download | latinime-a3e52e94fb4f37f00a647f1b1de5424ab597907a.tar.gz latinime-a3e52e94fb4f37f00a647f1b1de5424ab597907a.tar.xz latinime-a3e52e94fb4f37f00a647f1b1de5424ab597907a.zip |
Merge "Fix a native crash with shortcuts"
-rw-r--r-- | native/src/unigram_dictionary.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp index a6ecc2d28..bbae5a864 100644 --- a/native/src/unigram_dictionary.cpp +++ b/native/src/unigram_dictionary.cpp @@ -662,8 +662,9 @@ inline bool UnigramDictionary::processCurrentNode(const int initialPos, // The frequency should be here, because we come here only if this is actually // a terminal node, and we are on its last char. const int freq = BinaryFormat::readFrequencyWithoutMovingPointer(DICT_ROOT, pos); - TerminalAttributes terminalAttributes(DICT_ROOT, flags, - BinaryFormat::skipFrequency(flags, pos)); + const int childrenAddressPos = BinaryFormat::skipFrequency(flags, pos); + const int attributesPos = BinaryFormat::skipChildrenPosition(flags, childrenAddressPos); + TerminalAttributes terminalAttributes(DICT_ROOT, flags, attributesPos); onTerminal(freq, terminalAttributes, correction, queue); } |