From 0aaa930a5c1d400e69082eb60ccac47cc88f9859 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 18 Mar 2016 18:03:22 +0100 Subject: [PATCH] Do not assert when cursor is deeper than anchor This works around bug #9917 and might give us an occasion of obtaining a recipe for reproducing it. --- src/Cursor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index 8d94ddf5de..26aeabf1d5 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -1046,8 +1046,11 @@ CursorSlice Cursor::normalAnchor() const // LASSERT: There have been several bugs around this code, that seem // to involve failures to reset the anchor. We can at least not crash // in release mode by resetting it ourselves. - LASSERT(anchor_.depth() >= depth(), - const_cast(anchor_) = *this); + if (anchor_.depth() < depth()) { + LYXERR0("Cursor is deeper than anchor. PLEASE REPORT.\nCursor is" + << *this); + const_cast(anchor_) = *this; + } CursorSlice normal = anchor_[depth() - 1]; if (depth() < anchor_.depth() && top() <= normal) { -- 2.39.2