Explorar o código

Sanity check for a `nullptr`

gingerBill hai 1 ano
pai
achega
a2b23de0a7
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/check_expr.cpp

+ 3 - 1
src/check_expr.cpp

@@ -6812,7 +6812,9 @@ gb_internal CallArgumentData check_call_arguments_proc_group(CheckerContext *c,
 			for_array(i, procs) {
 			for_array(i, procs) {
 				Entity *proc = procs[i];
 				Entity *proc = procs[i];
 				Type *t = base_type(proc->type);
 				Type *t = base_type(proc->type);
-				if (t->kind != Type_Proc) continue;
+				if (t == nullptr || t->kind != Type_Proc) {
+					continue;
+				}
 
 
 				TypeProc *pt = &t->Proc;
 				TypeProc *pt = &t->Proc;
 				if (pt->param_count == 0) {
 				if (pt->param_count == 0) {