diff options
| author | gingerBill <bill@gingerbill.org> | 2023-11-04 14:53:42 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-11-04 14:53:42 +0000 |
| commit | 5edb2c568840248f63de3fab58a02f134f182525 (patch) | |
| tree | ccd703c4b1d1ae06fb7b014905b9b6669417785d /src/check_expr.cpp | |
| parent | ce5e7998ba235d3f444220f4093bf52d8615af21 (diff) | |
Fix #2913
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index d85f119c3..5cc548739 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2768,6 +2768,11 @@ gb_internal void check_shift(CheckerContext *c, Operand *x, Operand *y, Ast *nod gb_string_free(to_type); x->mode = Addressing_Invalid; } + } else if (!is_type_integer(x->type)) { + gbString x_str = expr_to_string(x->expr); + error(node, "Non-integer shifted operand '%s' is not allowed", x_str); + gb_string_free(x_str); + x->mode = Addressing_Invalid; } // x->value = x_val; return; |