aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2025-02-24 15:49:49 +0000
committergingerBill <bill@gingerbill.org>2025-02-24 15:49:49 +0000
commitd0d5cf800eb0dc039c124cc62cea74589b6e2f6c (patch)
tree25fe929fd3fc92088eda0ccaa13d22af345c0d83 /src
parent344eb6cb42a635f36d669fee8fc25dc37c852ba1 (diff)
Fix `nullptr` check
Diffstat (limited to 'src')
-rw-r--r--src/types.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 056737af5..43fe625f2 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -2087,6 +2087,9 @@ gb_internal bool is_type_sliceable(Type *t) {
gb_internal Entity *type_get_polymorphic_parent(Type *t, Type **params_) {
t = base_type(t);
+ if (t == nullptr) {
+ return nullptr;
+ }
Type *parent = nullptr;
if (t->kind == Type_Struct) {
parent = t->Struct.polymorphic_parent;