From 7aa6f972da50cab0588a76bc62a8c3216fa97107 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 11 Jun 2016 23:08:54 -0400 Subject: [PATCH] Add a LATTEST, just in case this ever causes a problem. Fixes coverity #23363. --- src/Buffer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index f4d238fb29..12e3400f7c 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -4622,6 +4622,11 @@ static depth_type getDepth(DocIterator const & it) if (!it[i].inset().inMathed()) depth += it[i].paragraph().getDepth() + 1; // remove 1 since the outer inset does not count + // we should have at least one non-math inset, so + // depth should nevery be 0. but maybe it is worth + // marking this, just in case. + LATTEST(depth > 0); + // coverity[INTEGER_OVERFLOW] return depth - 1; } -- 2.39.2