aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_const.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-09-19 15:13:10 +0100
committergingerBill <bill@gingerbill.org>2023-09-19 15:13:10 +0100
commit8a13c9a8c84f4e1ca297e7963880691f110843a2 (patch)
tree279943b86ad8e4a094907c8a803acca8a7c4e9b6 /src/llvm_backend_const.cpp
parentb7560b7e00aaad7ef696b5ce55460f8e35ebf135 (diff)
parentecde06e3a31179bd8f86383fd65cfbce31ab6d9a (diff)
Merge branch 'master' into windows-llvm-13.0.0windows-llvm-13.0.0
Diffstat (limited to 'src/llvm_backend_const.cpp')
-rw-r--r--src/llvm_backend_const.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp
index 01b0528d0..fc7d4e2f7 100644
--- a/src/llvm_backend_const.cpp
+++ b/src/llvm_backend_const.cpp
@@ -467,7 +467,7 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, bo
}
if (value.kind == ExactValue_Invalid) {
- return lb_const_nil(m, type);
+ return lb_const_nil(m, original_type);
}
if (value.kind == ExactValue_Procedure) {
@@ -1052,13 +1052,14 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, bo
i32 index = field_remapping[f->Variable.field_index];
if (elem_type_can_be_constant(f->type)) {
if (sel.index.count == 1) {
- values[index] = lb_const_value(m, f->type, tav.value, allow_local).value;
+ values[index] = lb_const_value(m, f->type, tav.value, allow_local).value;
visited[index] = true;
} else {
if (!visited[index]) {
- values[index] = lb_const_value(m, f->type, {}, false).value;
+ values[index] = lb_const_value(m, f->type, {}, false).value;
visited[index] = true;
}
+
unsigned idx_list_len = cast(unsigned)sel.index.count-1;
unsigned *idx_list = gb_alloc_array(temporary_allocator(), unsigned, idx_list_len);
@@ -1171,7 +1172,6 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, bo
}
}
return lb_addr_load(p, v);
-
}
} else if (is_type_bit_set(type)) {
ast_node(cl, CompoundLit, value.value_compound);