[ox/std] Add null check for deallocating in consteval context Vector

(synced from 92f74b27d1)
This commit is contained in:
2025-07-26 18:31:41 -05:00
parent 9ae6631997
commit 25a8a2baf4
+3 -1
View File
@@ -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<void*>(items) != static_cast<void*>(m_data.data())) {
Allocator{}.deallocate(items, cap);