Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 512c669f authored by Jean Chalard's avatar Jean Chalard
Browse files

Fix a native crash with shortcuts

Creation of the TerminalAttributes object failed to take into
account that there may be children on this node.

Change-Id: I8224a1a51532d1a40a8555f46425e3744388326b
parent ca132ce8
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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);
        }