aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2020-09-21 20:48:23 -0400
committerPatrick Palka <ppalka@redhat.com>2020-09-21 20:48:23 -0400
commit813ad9c4dd5a779f12ad2abf710c6e75a3117ef0 (patch)
treeeb59e04eaa2006f8861caf593bab2d6f3f44eda8 /gcc
parentf017952d31ba8fa965106505bed5844cc1a63b4b (diff)
downloadgcc-813ad9c4dd5a779f12ad2abf710c6e75a3117ef0.zip
gcc-813ad9c4dd5a779f12ad2abf710c6e75a3117ef0.tar.gz
gcc-813ad9c4dd5a779f12ad2abf710c6e75a3117ef0.tar.bz2
libstdc++: Fix division by zero in std::sample
This fixes a division by zero in the selection-sampling std::__sample overload when the input range is empty (and hence __unsampled_sz is 0). libstdc++-v3/ChangeLog: * include/bits/stl_algo.h (__sample): Exit early when the input range is empty. * testsuite/25_algorithms/sample/3.cc: New test.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions