aboutsummaryrefslogtreecommitdiff
path: root/src/array.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/array.cpp')
-rw-r--r--src/array.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/array.cpp b/src/array.cpp
index f1a1f93e2..d8e25d25d 100644
--- a/src/array.cpp
+++ b/src/array.cpp
@@ -80,7 +80,9 @@ gb_internal Slice<T> slice_make(gbAllocator const &allocator, isize count) {
GB_ASSERT(count >= 0);
Slice<T> s = {};
s.data = gb_alloc_array(allocator, T, count);
- GB_ASSERT(s.data != nullptr);
+ if (count > 0) {
+ GB_ASSERT(s.data != nullptr);
+ }
s.count = count;
return s;
}