commit 7aa6f972da50cab0588a76bc62a8c3216fa97107
Author: Richard Heck <[email protected]>
Date: Sat Jun 11 23:08:54 2016 -0400
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 f4d238f..12e3400 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;
}