Fix rare UB / assertion failure in MdlibUnitTest
authorAndrey Alekseenko <al42and@gmail.com>
Tue, 21 Sep 2021 12:21:15 +0000 (15:21 +0300)
committerAndrey Alekseenko <al42and@gmail.com>
Tue, 21 Sep 2021 12:29:18 +0000 (15:29 +0300)
commit5ac8cda6fbe06ad272cd487108bfc0df0bcbb8ad
tree7a9d50c97e35f4ae029bfe2bfac31351e768c403
parent55175c5c7972bf52c124a25adbcd7f91b04800fd
Fix rare UB / assertion failure in MdlibUnitTest

In LeapFrogHostTestRunner::integrate, we were checking whether
testData->mdAtoms_.ptype is null, but we were not initializing this
field.

This was leading to occasional assertion failure in
ArrayRef constructor from this pointer when begin+size was overflowing,
which caused end < begin.

Only unit tests were affected.
src/gromacs/mdlib/tests/leapfrogtestdata.cpp