Merge "Fix a native crash with shortcuts"
diff --git a/native/src/unigram_dictionary.cpp b/native/src/unigram_dictionary.cpp
index a6ecc2d..bbae5a8 100644
--- a/native/src/unigram_dictionary.cpp
+++ b/native/src/unigram_dictionary.cpp
@@ -662,8 +662,9 @@
// 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);
}