aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_general.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-08-26 22:01:02 +0100
committergingerBill <bill@gingerbill.org>2021-08-26 22:01:02 +0100
commit726788a48310971b0df8f431968100786d2f8cab (patch)
tree21f9555a4bbd8d237a6155ceaea48add75cdc2ae /src/llvm_backend_general.cpp
parentcdd35607023a333ae096f5a7e1437082a437ff04 (diff)
Treat `Type_Tuple` closer to a `Type_Struct` in `lb_type`
Diffstat (limited to 'src/llvm_backend_general.cpp')
-rw-r--r--src/llvm_backend_general.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp
index 2348ac523..1bf3bab7c 100644
--- a/src/llvm_backend_general.cpp
+++ b/src/llvm_backend_general.cpp
@@ -1744,6 +1744,9 @@ LLVMTypeRef lb_type_internal(lbModule *m, Type *type) {
if (type->Tuple.variables.count == 1) {
return lb_type(m, type->Tuple.variables[0]->type);
} else {
+ m->internal_type_level += 1;
+ defer (m->internal_type_level -= 1);
+
unsigned field_count = cast(unsigned)(type->Tuple.variables.count);
LLVMTypeRef *fields = gb_alloc_array(temporary_allocator(), LLVMTypeRef, field_count);