Dmitry Bolshakov
Dmitry Bolshakov
AVX is tricky in kernel mode since it requires explicit saving of the corresponding context (upper part of UMM, ZMM registers
When building with optimizations, the compiler can chain `RUNTIME_FUNCTION` and `UNWIND_INFO` structures. Also see: * https://docs.microsoft.com/en-us/cpp/build/exception-handling-x64?view=msvc-160#chained-unwind-info-structures * https://habr.com/ru/company/aladdinrd/blog/322956/ * https://stackoverflow.com/questions/19808172/struct-runtime-function If this isn't taken into account, the [RIP update](https://github.com/DymOK93/KTL/blob/master/runtime/src/exc_engine/x64/unwind_handler.cpp#L210) won't...
https://github.com/DymOK93/KTL/blob/master/runtime/src/exc_engine/x64/unwind_handler.cpp A function in the C++ exception path must have a frame and an associated `.pdata` entry. Maybe force a bugcheck?..
`__std__terminate` is usually inserted by the compiler into the exception handler table for `noexcept` functions (funny fact: MSVC doesn't always do this in debug builds)
Two vector constructors erroneously marked as conditionally `noexcept`: * https://github.com/DymOK93/KTL/blob/master/include/vector.hpp#L105 * https://github.com/DymOK93/KTL/blob/master/include/vector.hpp#L117
https://github.com/DymOK93/KTL/blob/master/runtime/src/exc_engine/x64/catch.cpp#L290 and other: see `frame_walk_pdata`
Recent MSVC compiler uses ```c++ using ktl::crt::global_c_handler_t = int(__cdecl*)(); using ktl::crt::global_cxx_handler_t = void(__cdecl*)(); CRTALLOC(".CRT$XIA") ktl::crt::global_c_handler_t __xi_a[] {nullptr}; // C initializers (first) CRTALLOC(".CRT$XIZ") ktl::crt::global_c_handler_t __xi_z[] {nullptr}; // C initializers (last) CRTALLOC(".CRT$XCA")...
It can be useful, for example, to initialize `LIST_ENTRY` heads using NT routines.
```c++ template inline constexpr bool is_nothrow_swappable_with_v = ... template struct is_nothrow_swappable_with {...} ```