Am 30.01.2011 um 02:23 schrieb Enrico Forestieri: > On Sun, Jan 30, 2011 at 01:28:49AM +0100, Tommaso Cucinotta wrote: > >> Il 29/01/2011 19:12, Enrico Forestieri ha scritto: >>>> just don't even try it: my own brand new automated tests just started >>>> to fail because, with that template-ish thing, at the first attempt of >>>> typing a character in text-mode LyX was asserting :-). >>>> >>>> I'm using the Enrico's patch that works fine (at least on my 64-bit >>>> machine). >>> Yet, I think your idea is right for avoiding code duplication. Let's see >>> whether requiring explicit instantiations works. If yes, adding a >>> forgotten type would only require adding a single-line instantiation >>> declaration. >>> >>> So, does the attach patch work for you? >> >> If it is the same currently committed, then it is sufficient to: >> -) create a new file >> -) type any letter and kaboom! > > From the backtrace, it is clear that the assertion is unrelated to the > otexstream class and that it only occurs when continuous spell checking > is active. The culprit here is r37363. > > Specifically, the assertion is triggered by the following line > > char_type const c = d->text_[pos]; > > in Paragraph::isWordSeparator(). Seemingly, pos points to the position > immediately after the last character in d->text_.
Sorry, I was mislead by the test pos == size() at the end of isWordSeparator(). Obviously the author of that test function wants to return true for end-of-paragraph. But the test for it should come first. I did an explicitly test of that scenario and it did not crash here. But it seems I didn't enable the array bounds checker :( I fixed that with r37369. Stephan