Browse Source

Fix assert when return value expected.

Jeroen van Rijn 8 months ago
parent
commit
6d83755e92
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/check_expr.cpp

+ 2 - 2
src/check_expr.cpp

@@ -4454,8 +4454,8 @@ gb_internal ExactValue convert_exact_value_for_type(ExactValue v, Type *type) {
 }
 }
 
 
 gb_internal void convert_to_typed(CheckerContext *c, Operand *operand, Type *target_type) {
 gb_internal void convert_to_typed(CheckerContext *c, Operand *operand, Type *target_type) {
-	GB_ASSERT_NOT_NULL(target_type);
-	if (operand->mode == Addressing_Invalid ||
+	// GB_ASSERT_NOT_NULL(target_type);
+	if (target_type == nullptr || operand->mode == Addressing_Invalid ||
 	    operand->mode == Addressing_Type ||
 	    operand->mode == Addressing_Type ||
 	    is_type_typed(operand->type) ||
 	    is_type_typed(operand->type) ||
 	    target_type == t_invalid) {
 	    target_type == t_invalid) {