report error when builtin min/max has 1 (non-type) param

This commit is contained in:
jakubtomsu
2024-11-17 21:02:30 +01:00
committed by flysand7
parent 76d689a601
commit aaea7b27f2

View File

@@ -3170,6 +3170,10 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
return false;
}
if (ce->args.count <= 1) {
error(call, "Too few arguments for 'min', two or more are required");
return false;
}
bool all_constant = operand->mode == Addressing_Constant;
@@ -3343,6 +3347,11 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
gb_string_free(type_str);
return false;
}
if (ce->args.count <= 1) {
error(call, "Too few arguments for 'max', two or more are required");
return false;
}
bool all_constant = operand->mode == Addressing_Constant;