From 000dcb8672b68a6366ee48ce88c3adb57adecfd1 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Wed, 8 Mar 2017 16:50:03 +0100 Subject: [PATCH] Make a false positive explicit Pleases coverity --- src/mathed/MathData.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index 9d218987d3..8ff9461452 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -825,7 +825,10 @@ void MathData::collectParameters(Cursor * cur, } // put cursor in argument again - if (thisSlice != - 1 && thisPos == int(pos)) { + // Note: The first two expressions on the first line are + // equivalent (see caller), but making this explicit pleases + // coverity. + if (cur && thisSlice != -1 && thisPos == int(pos)) { cur->append(params.size() - 1, argPos); cur->append(argSlices); (*cur)[thisSlice].pos() = macroPos; -- 2.39.2