From 92f74b27d16a99821cbb4b6c2e025c9ad9d45323 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 26 Jul 2025 18:31:41 -0500 Subject: [PATCH] [ox/std] Add null check for deallocating in consteval context Vector --- deps/ox/src/ox/std/vector.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deps/ox/src/ox/std/vector.hpp b/deps/ox/src/ox/std/vector.hpp index faab0650..aa570621 100644 --- a/deps/ox/src/ox/std/vector.hpp +++ b/deps/ox/src/ox/std/vector.hpp @@ -87,7 +87,9 @@ struct VectorAllocator { constexpr void deallocate(T *items, std::size_t cap) noexcept { // small vector optimization cannot be done it constexpr, but it doesn't really matter in constexpr if (std::is_constant_evaluated()) { - Allocator{}.deallocate(items, cap); + if (items) { + Allocator{}.deallocate(items, cap); + } } else { if (items && static_cast(items) != static_cast(m_data.data())) { Allocator{}.deallocate(items, cap);