aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2023-10-26 15:21:47 +0100
committerGitHub <noreply@github.com>2023-10-26 15:21:47 +0100
commite86d7f1fb03d90f5a1e664acecf81a6c69d754fc (patch)
treefbab8666a038f978eabc544d5708319a10d5bc61 /src/check_builtin.cpp
parent962d59999639edfe64fb15c5b4587993c4e4a5ec (diff)
parentba536d67b4e08e1149f78eea46377d727f6d7251 (diff)
Merge pull request #2895 from jakubtomsu/fix-builtin-const-int-checks
Fix incorrect type condition in some built-in procs
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index 49095a7a8..77ba6b435 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -5170,7 +5170,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
Operand op = {};
check_expr(c, &op, ce->args[1]);
- if (op.mode != Addressing_Constant && !is_type_integer(op.type)) {
+ if (op.mode != Addressing_Constant || !is_type_integer(op.type)) {
error(op.expr, "Expected a constant integer for the index of procedure parameter value");
return false;
}
@@ -5229,7 +5229,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
Operand op = {};
check_expr(c, &op, ce->args[1]);
- if (op.mode != Addressing_Constant && !is_type_integer(op.type)) {
+ if (op.mode != Addressing_Constant || !is_type_integer(op.type)) {
error(op.expr, "Expected a constant integer for the index of procedure parameter value");
return false;
}
@@ -5307,7 +5307,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As
} else {
Operand op = {};
check_expr(c, &op, ce->args[1]);
- if (op.mode != Addressing_Constant && !is_type_integer(op.type)) {
+ if (op.mode != Addressing_Constant || !is_type_integer(op.type)) {
error(op.expr, "Expected a constant integer for the index of record parameter value");
return false;
}