llvm-project/libcxx/src
Eric Fiselier c0d5590a3b Fix bugs in filesystem detected by _LIBCPP_ASSERT.
Recently I turned on libc++'s debug mode assertions when
CMake is configured with -DLIBCXX_ENABLE_ASSERTIONS=ON. This
change exposed assertion failures caused by bugs in filesystem.
This patch fixes those failures.

The first bug was that `PathParser` was using front()/back()
on empty string views in order to get the address of the character.
However this is UB on empty strings. Those operations now use data()
to obtain the pointer.

The second bug was that directory_iterator attempted to capture errno when it
was unset and there was an assertion to detect this.

llvm-svn: 294360
2017-02-07 21:51:58 +00:00
..
experimental Fix bugs in filesystem detected by _LIBCPP_ASSERT. 2017-02-07 21:51:58 +00:00
include Refer to _LIBCPP_MSVC macro where applicable 2017-02-06 05:26:49 +00:00
support win32: temporarily disable setting locale on 14+ 2017-01-02 21:09:16 +00:00
algorithm.cpp Mark libc++ internal globals with _LIBCPP_SAFE_STATIC. 2016-09-28 22:08:13 +00:00
any.cpp [libcxx] Add std::any 2016-08-11 03:13:11 +00:00
bind.cpp Implement LWG 2488 - Make the placeholders constexpr. 2016-06-26 21:01:34 +00:00
chrono.cpp [Chrono][Darwin] Include header for gettimeofday 2017-01-10 00:51:02 +00:00
condition_variable.cpp Recommit [libcxx] Never use <cassert> within libc++ 2017-02-04 23:22:28 +00:00
debug.cpp Fix debug mode build w/o exceptions 2016-12-28 05:20:27 +00:00
exception.cpp Refer to _LIBCPP_MSVC macro where applicable 2017-02-06 05:26:49 +00:00
future.cpp Make it possible to build a no-exceptions variant of libcxx. 2015-11-10 11:41:22 +00:00
hash.cpp Fix typos 2014-05-15 11:27:39 +00:00
ios.cpp [libc++] Fix extern template visibility for Windows 2016-09-19 18:29:07 +00:00
iostream.cpp Explicitly specify MSVC mangling of iostream globals. Patch from Dave Lee 2017-01-07 06:09:12 +00:00
locale.cpp Add _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM] macros. 2017-01-06 21:42:58 +00:00
memory.cpp Add ABI option to remove recently inlined __shared_count functions from the library. 2017-01-17 03:16:26 +00:00
mutex.cpp Recommit [libcxx] Never use <cassert> within libc++ 2017-02-04 23:22:28 +00:00
new.cpp Disable aligned new/delete on Apple platforms without posix_memalign 2017-01-20 01:47:26 +00:00
optional.cpp Restore the _NOEXCEPT on the dtor of bad_optional_access. Destructors are noexcept by default, so it's not really needed, but the other exception classes have the _NOEXCEPT, and gcc complains if these are missing. I think we should remove them all - but not today. 2017-02-05 20:52:32 +00:00
random.cpp random: include __config before building 2016-12-31 00:00:21 +00:00
regex.cpp [libcxx] Remove pragmas that were needed to suppress warnings produced 2016-01-28 06:13:36 +00:00
shared_mutex.cpp Implement N4508: shared_mutex. Reviewed as http://reviews.llvm.org/D10480 2015-06-30 14:04:14 +00:00
stdexcept.cpp Recommit r290839 - Fix configuring and building libc++ w/o an ABI library. 2017-01-03 01:18:48 +00:00
string.cpp Revert r284193 - it is not correct on OS X 2016-10-14 04:21:24 +00:00
strstream.cpp Fix or suppress GCC warnings during build. 2016-08-29 20:43:38 +00:00
system_error.cpp Recommit [libcxx] Never use <cassert> within libc++ 2017-02-04 23:22:28 +00:00
thread.cpp Refer to _LIBCPP_MSVC macro where applicable 2017-02-06 05:26:49 +00:00
typeinfo.cpp Improve CMake and LIT support for Windows 2017-01-16 20:47:35 +00:00
utility.cpp
valarray.cpp Revert "Turn off extern templates for most uses." 2014-08-15 17:58:56 +00:00
variant.cpp Implement C++17 <variant>. Patch from Michael Park! 2016-12-02 23:00:05 +00:00