diff --git a/include/def.h b/include/def.h index ad90dd1..0cac91c 100644 --- a/include/def.h +++ b/include/def.h @@ -58,7 +58,7 @@ constexpr auto impl(T* const (& p)) -> IsImplComfortable { template constexpr auto clear_impl(T* p) -> IsImplComfortable { - impl(p)->~T(); + if (p != nullptr) impl(p)->~T(); } template diff --git a/src/ipc.cpp b/src/ipc.cpp index 4536569..2a90285 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -51,8 +51,8 @@ using cache_t = mem::vector; template cache_t make_cache(byte_t const (& data)[N]) { return { - static_cast(data), - static_cast(data) + N + static_cast(data), + static_cast(data) + N }; }