aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2020-08-05 23:14:11 +0100
committergingerBill <bill@gingerbill.org>2020-08-05 23:14:11 +0100
commit74ed779616aead2d9dc6f5123c59ad561b9d594e (patch)
treeb4fdf5f47e25ccee5a560805db89690439c52436 /src/check_expr.cpp
parent9f24188ec885d0d09ca8823ccf3210467dc61e11 (diff)
Fix #702
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 0633b20ea..6279967ad 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -4783,6 +4783,11 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
}
if (operand->mode == Addressing_Type) {
+ if (ce->args.count != 1) {
+ error(call, "If 'min' gets a type, only 1 arguments is allowed, got %td", ce->args.count);
+ return false;
+ }
+
if (is_type_boolean(type)) {
operand->mode = Addressing_Constant;
operand->type = original_type;
@@ -4951,6 +4956,11 @@ bool check_builtin_procedure(CheckerContext *c, Operand *operand, Ast *call, i32
}
if (operand->mode == Addressing_Type) {
+ if (ce->args.count != 1) {
+ error(call, "If 'max' gets a type, only 1 arguments is allowed, got %td", ce->args.count);
+ return false;
+ }
+
if (is_type_boolean(type)) {
operand->mode = Addressing_Constant;
operand->type = original_type;