Buckets:
arudradey/fullhtml-storage / emsdk /upstream /emscripten /system /lib /libcxxabi /src /cxa_handlers.cpp
| //===----------------------------------------------------------------------===// | |
| // | |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | |
| // See https://llvm.org/LICENSE.txt for license information. | |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| // | |
| // | |
| // This file implements the functionality associated with the terminate_handler, | |
| // unexpected_handler, and new_handler. | |
| //===----------------------------------------------------------------------===// | |
| namespace std | |
| { | |
| unexpected_handler | |
| get_unexpected() noexcept | |
| { | |
| return __libcpp_atomic_load(&__cxa_unexpected_handler, _AO_Acquire); | |
| } | |
| void | |
| __unexpected(unexpected_handler func) | |
| { | |
| func(); | |
| // unexpected handler should not return | |
| __abort_message("unexpected_handler unexpectedly returned"); | |
| } | |
| __attribute__((noreturn)) | |
| void | |
| unexpected() | |
| { | |
| __unexpected(get_unexpected()); | |
| } | |
| terminate_handler | |
| get_terminate() noexcept | |
| { | |
| return __libcpp_atomic_load(&__cxa_terminate_handler, _AO_Acquire); | |
| } | |
| void | |
| __terminate(terminate_handler func) noexcept | |
| { | |
| try | |
| { | |
| func(); | |
| // handler should not return | |
| __abort_message("terminate_handler unexpectedly returned"); | |
| } | |
| catch (...) | |
| { | |
| // handler should not throw exception | |
| __abort_message("terminate_handler unexpectedly threw an exception"); | |
| } | |
| } | |
| __attribute__((noreturn)) | |
| void | |
| terminate() noexcept | |
| { | |
| // If there might be an uncaught exception | |
| using namespace __cxxabiv1; | |
| __cxa_eh_globals* globals = __cxa_get_globals_fast(); | |
| if (globals) | |
| { | |
| __cxa_exception* exception_header = globals->caughtExceptions; | |
| if (exception_header) | |
| { | |
| _Unwind_Exception* unwind_exception = | |
| reinterpret_cast<_Unwind_Exception*>(exception_header + 1) - 1; | |
| if (__isOurExceptionClass(unwind_exception)) | |
| __terminate(exception_header->terminateHandler); | |
| } | |
| } | |
| __terminate(get_terminate()); | |
| } | |
| new_handler | |
| get_new_handler() noexcept | |
| { | |
| return __libcpp_atomic_load(&__cxa_new_handler, _AO_Acquire); | |
| } | |
| } // std | |
Xet Storage Details
- Size:
- 2.57 kB
- Xet hash:
- 62f7febc91806b72a7cea14d1821e60840a5a1758618025c1fc7d0b0b822eb65
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.