Browse Source

Merge pull request #2176 from jaspergeer/fix-untyped-segfault

fix #2129 Segfault in compiler when void function used for its return value
gingerBill 2 years ago
parent
commit
79baddc157
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/types.cpp

+ 3 - 0
src/types.cpp

@@ -1257,6 +1257,9 @@ bool is_type_typed(Type *t) {
 }
 }
 bool is_type_untyped(Type *t) {
 bool is_type_untyped(Type *t) {
 	t = base_type(t);
 	t = base_type(t);
+	if (t == nullptr) {
+		return false;
+	}
 	if (t->kind == Type_Basic) {
 	if (t->kind == Type_Basic) {
 		return (t->Basic.flags & BasicFlag_Untyped) != 0;
 		return (t->Basic.flags & BasicFlag_Untyped) != 0;
 	}
 	}