commit 80b9efd74cc8bd6db0616a648abf5b97270048ff
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Sun Nov 23 15:26:24 2025 +0100
Add assertions to please Coverity Scan
---
src/insets/InsetFloat.cpp | 2 ++
src/mathed/MathRow.cpp | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp
index 2a725065b4..b434aa9de8 100644
--- a/src/insets/InsetFloat.cpp
+++ b/src/insets/InsetFloat.cpp
@@ -38,6 +38,7 @@
#include "support/debug.h"
#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lassert.h"
#include "support/Lexer.h"
#include "support/lstrings.h"
@@ -536,6 +537,7 @@ std::tuple<InsetCode, const Inset *, const InsetCaption *,
const InsetLabel *> d
case CAPTION_CODE:
if (!caption) {
caption =
dynamic_cast<const InsetCaption *>(inset);
+ LATTEST(caption !=
nullptr);
// A label often hides
in a caption. Make a simplified version of the main loop.
if (!label) {
diff --git a/src/mathed/MathRow.cpp b/src/mathed/MathRow.cpp
index 26de8b998d..be454a80a3 100644
--- a/src/mathed/MathRow.cpp
+++ b/src/mathed/MathRow.cpp
@@ -278,7 +278,7 @@ void MathRow::metrics(MetricsInfo & mi, Dimension & dim)
case END:
if (e.inset) {
e.inset->afterMetrics();
- LATTEST(dim_insets.back().first == e.inset);
+ LATTEST(!dim_insets.empty() &&
dim_insets.back().first == e.inset);
d = dim_insets.back().second;
afterMetricsMarkers(mi, e, d);
d.wid += e.before + e.after;
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs