From 7110128236989c9f957b7345d5615e9df8a337f2 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 16 May 2019 23:52:10 +0100 Subject: [PATCH] Remove incorrect assertion from filesystem::absolute The assertion is wrong, it should be *s.end() == 0, but that's not allowed. Just remove it, but keep the comment. * src/c++17/fs_ops.cc (absolute(const path&, error_code&)) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Remove bogus assertion. From-SVN: r271300 --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/src/c++17/fs_ops.cc | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ac7914db65e..934d5139f70 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2019-05-16 Jonathan Wakely + * src/c++17/fs_ops.cc (absolute(const path&, error_code&)) + [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Remove bogus assertion. + * include/std/variant (__overload_set): Remove. (_Arr): New helper. (_Build_FUN): New class template to define a single FUN overload, diff --git a/libstdc++-v3/src/c++17/fs_ops.cc b/libstdc++-v3/src/c++17/fs_ops.cc index 2d13b172d69..274ee7f0834 100644 --- a/libstdc++-v3/src/c++17/fs_ops.cc +++ b/libstdc++-v3/src/c++17/fs_ops.cc @@ -96,6 +96,7 @@ fs::absolute(const path& p, error_code& ec) } #ifdef _GLIBCXX_FILESYSTEM_IS_WINDOWS + // s must remain null-terminated wstring_view s = p.native(); if (p.has_root_directory()) // implies !p.has_root_name() @@ -108,9 +109,6 @@ fs::absolute(const path& p, error_code& ec) s.remove_prefix(std::min(s.length(), pos) - 1); } - // s must be null-terminated - __glibcxx_assert(!s.empty() && s.back() == 0); - uint32_t len = 1024; wstring buf; do -- 2.30.2