Fix crash with 'z of ...' within an expression
authorTeemu Murtola <teemu.murtola@gmail.com>
Fri, 2 Jan 2015 17:20:06 +0000 (19:20 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sat, 3 Jan 2015 01:18:01 +0000 (02:18 +0100)
commit96caf1159f0c6d84d0f39d63b0b8e08e03e5956c
tree4726e771129db2a60f40401dd2fdee0c1fea2b04
parentbd50088ca55e39e2f548641fa15409601045be23
Fix crash with 'z of ...' within an expression

When a 'z of ...' construct was used within an arithmetic expression in
a selection, there were out-of-bounds array writes occurring during
selection compilation.  Initialize the number of values produced by such
constructs correctly to avoid this.

Change-Id: I7fb62c086bc02a96e90e35ab0a2d9944518900db
src/gromacs/selection/compiler.cpp
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesKeywordOfPositionsInArithmetic.xml [new file with mode: 0644]
src/gromacs/selection/tests/selectioncollection.cpp