From 25d64bf43aba78a1ed20c88dfdc4cac269b53985 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 7 Mar 2017 11:56:59 +0100 Subject: [PATCH] Fix test to make coverity happy It is not obvious that cur is not null iff thisSlice is not -1, but this is what happens in the caller. --- 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 3f298afad1..9d218987d3 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -781,7 +781,10 @@ void MathData::collectParameters(Cursor * cur, // fix cursor vector argSlices; int argPos = 0; - if (thisSlice != -1 && thisPos == int(pos)) + // Note: The two expressions on the first line are equivalent + // (see caller), but making this explicit pleases coverity. + if (cur && thisSlice != -1 + && thisPos == int(pos)) cur->cutOff(thisSlice, argSlices); // which kind of parameter is it? In {}? With index x^n? -- 2.39.5