aboutsummaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-01-13 11:14:08 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-01-13 11:14:08 -0800
commiteaf8b15d98249d3e302a78820f029ca2b7711e75 (patch)
treeb1b1b8a5398e8af60c95c16634390ba1393a2d1f /native/src
parentc2d44eeded39e3c32f91e19b57ed3a97a56419d8 (diff)
parenta3e52e94fb4f37f00a647f1b1de5424ab597907a (diff)
downloadlatinime-eaf8b15d98249d3e302a78820f029ca2b7711e75.tar.gz
latinime-eaf8b15d98249d3e302a78820f029ca2b7711e75.tar.xz
latinime-eaf8b15d98249d3e302a78820f029ca2b7711e75.zip
am a3e52e94: Merge "Fix a native crash with shortcuts"
* commit 'a3e52e94fb4f37f00a647f1b1de5424ab597907a': Fix a native crash with shortcuts
Diffstat (limited to 'native/src')
-rw-r--r--native/src/unigram_dictionary.cpp5
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);
}