mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-02 20:58:15 +00:00
report error when builtin min/max has 1 (non-type) param
This commit is contained in:
@@ -3170,6 +3170,10 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
return false;
|
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;
|
bool all_constant = operand->mode == Addressing_Constant;
|
||||||
|
|
||||||
@@ -3344,6 +3348,11 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
|
|||||||
return false;
|
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;
|
bool all_constant = operand->mode == Addressing_Constant;
|
||||||
|
|
||||||
auto operands = array_make<Operand>(heap_allocator(), 0, ce->args.count);
|
auto operands = array_make<Operand>(heap_allocator(), 0, ce->args.count);
|
||||||
|
|||||||
Reference in New Issue
Block a user