diff options
| author | gingerBill <bill@gingerbill.org> | 2025-02-20 17:50:56 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2025-02-20 17:50:56 +0000 |
| commit | e8c38e74274b57a5de71d983ce9231bb7d27458e (patch) | |
| tree | bbb0de5944ea3eb11c2201560ead65391a312802 /src/llvm_backend_utility.cpp | |
| parent | 614c0dd7401271f7ddad5eaeb4de234021fe387c (diff) | |
Handle `any` correctly for 32-bit systems
Diffstat (limited to 'src/llvm_backend_utility.cpp')
| -rw-r--r-- | src/llvm_backend_utility.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/llvm_backend_utility.cpp b/src/llvm_backend_utility.cpp index aa425a9d5..0ba95bb1e 100644 --- a/src/llvm_backend_utility.cpp +++ b/src/llvm_backend_utility.cpp @@ -971,6 +971,13 @@ gb_internal i32 lb_convert_struct_index(lbModule *m, Type *t, i32 index) { if (t->kind == Type_Struct) { auto field_remapping = lb_get_struct_remapping(m, t); return field_remapping[index]; + } else if (is_type_any(t) && build_context.ptr_size == 4) { + GB_ASSERT(t->kind == Type_Basic); + GB_ASSERT(t->Basic.kind == Basic_any); + switch (index) { + case 0: return 0; // data + case 1: return 2; // id + } } else if (build_context.ptr_size != build_context.int_size) { switch (t->kind) { case Type_Basic: |