diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-11-20 11:14:58 +0000 |
commit | 31773f157bf8164364649b5f470f52dece0a4317 (patch) | |
tree | 33d0f7eef45303ab68cf08ab381ce5e5e36c5240 /contrib/libs/cxxsupp/libcxx/patches/01-commit-e0e82fc-initial.patch | |
parent | 2c7938962d8689e175574fc1e817c05049f27905 (diff) | |
parent | eff600952d5dfe17942f38f510a8ac2b203bb3a5 (diff) | |
download | ydb-31773f157bf8164364649b5f470f52dece0a4317.tar.gz |
Merge branch 'rightlib' into mergelibs-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 |