mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 03:46:53 -05:00
This fixes a 'for' loop in std::piecewise_linear_distribution that increments two iterators with a comma operator between them, making it vulnerable to evil overloads of the comma operator. It also changes a 'for' loop used by some other distributions, even though those are only used with std::vector<double>::iterator and so won't find any overloaded commas. libstdc++-v3/ChangeLog: PR libstdc++/122062 * include/bits/random.tcc (__detail::__normalize): Use void cast for operands of comma operator. (piecewise_linear_distribution): Likewise. * testsuite/26_numerics/random/piecewise_linear_distribution/cons/122062.cc: New test. Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com> Reviewed-by: Hewill Kang <hewillk@gmail.com>
file: libstdc++-v3/README New users may wish to point their web browsers to the file index.html in the 'doc/html' subdirectory. It contains brief building instructions and notes on how to configure the library in interesting ways.