aboutsummaryrefslogtreecommitdiff
path: root/src/array.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-03-03 13:56:34 +0000
committergingerBill <bill@gingerbill.org>2022-03-03 13:56:34 +0000
commitfcab5508be19ac071a19f392bcd1824e3806af95 (patch)
tree770f7a3a85d94d56eae5f69cd4fb7e23d7d63c6d /src/array.cpp
parentad6ea3d6aa564ad228cf8883a8fd858135a16030 (diff)
parent0b05650366258a56c8da17848e238a21a377afb3 (diff)
Merge branch 'master' into odin-ast-changes
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 ac3727978..d08bd647f 100644
--- a/src/array.cpp
+++ b/src/array.cpp
@@ -89,7 +89,9 @@ template <typename T>
void slice_init(Slice<T> *s, gbAllocator const &allocator, isize count) {
GB_ASSERT(count >= 0);
s->data = gb_alloc_array(allocator, T, count);
- GB_ASSERT(s->data != nullptr);
+ if (count > 0) {
+ GB_ASSERT(s->data != nullptr);
+ }
s->count = count;
}