libchewing
libchewing copied to clipboard
assertion fail in ChoiceEndChoice()
How to reproduce
$ xxd -r > assert-AddChi
00000000: 4406 06c4 0030 3c D....0<
$ ./configure
$ make all check
$ ./test/stress -loop 1 -extra -file assert-AddChi
stress: choice.c:477: int ChoiceEndChoice(ChewingData *): Assertion `pgdata->chiSymbolCursor <= pgdata->chiSymbolBufLen' failed.
This is due to buggy code of cursor manipulation introduced by EasySymbolInput. cc original author of EasySymbolInput, @PCMan
@PCMan could you please take a look? The code is messy and hard to understand for others.
One key function call is chewing_set_maxChiSymbolLen(0).
I'm not sure what does MIN_CHI_SYMBOL_LEN=0 mean.
MIN_CHI_SYMBOL_LEN means the minimal valid input for function chewing_set_maxChiSymbolLen. I think it shall be 1 instead of 0.