Fix issues for clang-analyzer-8
[alexxy/gromacs.git] / src / gromacs / mdrun / shellfc.cpp
index 564dc42fbc2ce87eec5d65becfa0d819df7493f0..8c4e39a6e55c6b73ff0406339e326c51f666741f 100644 (file)
@@ -78,6 +78,7 @@
 #include "gromacs/utility/arraysize.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 typedef struct {
@@ -161,6 +162,8 @@ static void predict_shells(FILE *fplog, rvec x[], rvec v[], real dt,
     real                  dt_1, fudge, tm, m1, m2, m3;
     rvec                 *ptr;
 
+    GMX_RELEASE_ASSERT(mass || mtop, "Must have masses or a way to look them up");
+
     /* We introduce a fudge factor for performance reasons: with this choice
      * the initial force on the shells is about a factor of two lower than
      * without