aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-09-22 00:55:28 +0100
committergingerBill <bill@gingerbill.org>2022-09-22 00:55:28 +0100
commit532133d6485321f075db7bbcd5e26d5fd3ca3770 (patch)
tree7cee476aef135e06e99bd593405efa209839ddeb /src
parentc056a0d108d70932f33c75fd7f9dd5cb82808e1f (diff)
Minor technical improvement
Diffstat (limited to 'src')
-rw-r--r--src/llvm_backend_expr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp
index e8138d0a2..6c046fa4a 100644
--- a/src/llvm_backend_expr.cpp
+++ b/src/llvm_backend_expr.cpp
@@ -3717,8 +3717,11 @@ lbAddr lb_build_addr_index_expr(lbProcedure *p, Ast *expr) {
ExactValue idx = exact_value_sub(index_tv.value, *t->EnumeratedArray.min_value);
index = lb_const_value(p->module, index_type, idx);
} else {
- index = lb_emit_conv(p, lb_build_expr(p, ie->index), t_int);
- index = lb_emit_arith(p, Token_Sub, index, lb_const_value(p->module, index_type, *t->EnumeratedArray.min_value), index_type);
+ index = lb_emit_arith(p, Token_Sub,
+ lb_build_expr(p, ie->index),
+ lb_const_value(p->module, index_type, *t->EnumeratedArray.min_value),
+ index_type);
+ index = lb_emit_conv(p, index, t_int);
}
} else {
index = lb_emit_conv(p, lb_build_expr(p, ie->index), t_int);