From ec96bbe42991290f3b0798808cfd8e3f7a9b4df9 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 16 Jan 2010 00:22:15 +0000 Subject: [PATCH] Try to fix an assert coming from "gcc vector-index checks". git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33052 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Compare.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Compare.cpp b/src/Compare.cpp index aabbed7e3c..92c5cf20bb 100644 --- a/src/Compare.cpp +++ b/src/Compare.cpp @@ -444,6 +444,13 @@ static bool equal(Inset const * i_o, Inset const * i_n) static bool equal(DocIterator & o, DocIterator & n) { + // Explicitly check for this, so we won't call + // Paragraph::getChar for the last pos. + bool const o_lastpos = o.pos() == o.lastpos(); + bool const n_lastpos = n.pos() == n.lastpos(); + if (o_lastpos || n_lastpos) + return o_lastpos && n_lastpos; + Paragraph const & old_par = o.text()->getPar(o.pit()); Paragraph const & new_par = n.text()->getPar(n.pit()); -- 2.39.5