]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR libstdc++/85632 fix wraparound in filesystem::space
authorJonathan Wakely <jwakely@redhat.com>
Thu, 3 May 2018 20:39:31 +0000 (21:39 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 3 May 2018 20:39:31 +0000 (21:39 +0100)
commit2bec01fac4828894c77e9417fcca4b211268ce66
tree63f44a7624ef0769bf6cfad2174b6625ca33fbc1
parent73618f3c74b7532b8edb8055b5f4644ea9d52ec3
PR libstdc++/85632 fix wraparound in filesystem::space

On 32-bit targets any values over 4GB would wrap and produce the wrong
result.

PR libstdc++/85632 use uintmax_t for arithmetic
* src/filesystem/ops.cc (experimental::filesystem::space): Perform
arithmetic in result type.
* testsuite/experimental/filesystem/operations/space.cc: New.

From-SVN: r259911
libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/space.cc [new file with mode: 0644]