Fix potential FPE in selection tests
authorTeemu Murtola <teemu.murtola@gmail.com>
Sun, 31 May 2015 03:21:40 +0000 (06:21 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 4 Jun 2015 18:39:45 +0000 (20:39 +0200)
commit7ca8a04c4f9b653033b948fd6391a09f5b8c50a7
treed17edebc77eebf9eccf8430127def97d626e2e29
parent1e7d2af2ea3b3fc3dfeae17baaec30b5bca4e1ab
Fix potential FPE in selection tests

Always initialize dynamic evaluation results to zero during the static
analysis pass.  The old code tried to do that, but missed a few cases
where the same expression was evaluated more than once.  Even during
static analysis, some dynamic arithmetic expressions are actually
evaluated, which could lead to FPE if the memory was uninitialized, even
though the results of the evaluation were never used.

Part of #1677.

Change-Id: I0cf73eb656d58f7ad08f6e12705c6d8a273adf84
src/gromacs/selection/compiler.cpp