aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAirtz <johan.bouriaud@gmail.com>2025-06-24 16:09:42 +0200
committerAirtz <johan.bouriaud@gmail.com>2025-06-24 16:09:42 +0200
commitfb3bccdd3e31c8c237721f6658722e0bfb54e71c (patch)
treedeeb16d4779ee86909a9f031758b7a7aa12db7fb /src
parent36ea05fba90a64f5f10644f87f54ec360c76dcd2 (diff)
Fix an oversight for operators with more than 2 chars
Diffstat (limited to 'src')
-rw-r--r--src/check_stmt.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp
index 620e9fb74..07801b477 100644
--- a/src/check_stmt.cpp
+++ b/src/check_stmt.cpp
@@ -2481,8 +2481,7 @@ gb_internal void check_assign_stmt(CheckerContext *ctx, Ast *node) {
check_expr(ctx, &lhs, as->lhs[0]);
check_binary_expr(ctx, &rhs, binary_expr, nullptr, true);
if (rhs.mode != Addressing_Invalid) {
- // NOTE(bill): Only use the first one will be used
- be->op.string = substring(be->op.string, 0, 1);
+ be->op.string = substring(be->op.string, 0, be->op.string.len - 1);
rhs.expr = binary_expr;
check_assignment_variable(ctx, &lhs, &rhs, str_lit("assignment operation"));
}