diff options
author | Maxim Yurchuk <maxim-yurchuk@ydb.tech> | 2024-11-20 17:37:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-20 17:37:57 +0000 |
commit | f76323e9b295c15751e51e3443aa47a36bee8023 (patch) | |
tree | 4113c8cad473a33e0f746966e0cf087252fa1d7a /contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch | |
parent | 753ecb8d410a4cb459c26f3a0082fb2d1724fe63 (diff) | |
parent | a7b9a6afea2a9d7a7bfac4c5eb4c1a8e60adb9e6 (diff) | |
download | ydb-f76323e9b295c15751e51e3443aa47a36bee8023.tar.gz |
Merge pull request #11788 from ydb-platform/mergelibs-241120-1113
Library import 241120-1113
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch')
-rw-r--r-- | contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch b/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch index bd826ae06e..6e2e94aaab 100644 --- a/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch +++ b/contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch @@ -1,5 +1,5 @@ diff --git a/include/__config b/include/__config -index 52bf12f..e431997 100644 +index 65ce6d6..ab696fb 100644 --- a/include/__config +++ b/include/__config @@ -131,7 +131,12 @@ @@ -45,27 +45,26 @@ index 63a119a..61f2cc5 100644 # define _LIBCPP_FILESYSTEM_USE_SENDFILE #elif defined(__APPLE__) || __has_include(<copyfile.h>) diff --git a/src/new.cpp b/src/new.cpp -index c435c5f..6d5b221 100644 +index 033bba5..318b062 100644 --- a/src/new.cpp +++ b/src/new.cpp -@@ -37,8 +37,17 @@ operator new(std::size_t size) _THROW_BAD_ALLOC - else - #ifndef _LIBCPP_HAS_NO_EXCEPTIONS - throw std::bad_alloc(); -+#else -+#ifdef __EMSCRIPTEN__ -+ // Abort here so that when exceptions are disabled, we do not just -+ // return 0 when malloc returns 0. -+ // We could also do this with set_new_handler, but that adds a -+ // global constructor and a table entry, overhead that we can avoid -+ // by doing it this way. -+ abort(); - #else - break; -+#endif - #endif - } - return p; +@@ -41,6 +41,16 @@ _LIBCPP_WEAK void* operator new(std::size_t size) _THROW_BAD_ALLOC { + # ifndef _LIBCPP_HAS_NO_EXCEPTIONS + if (p == nullptr) + throw std::bad_alloc(); ++# else ++# ifdef __EMSCRIPTEN__ ++ if (p == nullptr) ++ // Abort here so that when exceptions are disabled, we do not just ++ // return 0 when malloc returns 0. ++ // We could also do this with set_new_handler, but that adds a ++ // global constructor and a table entry, overhead that we can avoid ++ // by doing it this way. ++ abort(); ++# endif + # endif + return p; + } diff --git a/src/support/runtime/exception_fallback.ipp b/src/support/runtime/exception_fallback.ipp index 3b2716d..c14c375 100644 --- a/src/support/runtime/exception_fallback.ipp |