From: Richard Heck Date: Sun, 12 Jun 2016 03:08:54 +0000 (-0400) Subject: Add a LATTEST, just in case this ever causes a problem. X-Git-Tag: 2.3.0alpha1~1490 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=7aa6f972da50cab0588a76bc62a8c3216fa97107;p=features.git Add a LATTEST, just in case this ever causes a problem. Fixes coverity #23363. --- 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; }