aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2021-09-13 18:23:58 +0100
committerGitHub <noreply@github.com>2021-09-13 18:23:58 +0100
commit4e4ac460e53272140fa5af3a2e005d9091ba8654 (patch)
tree15d6dd8f98f9b47b4efd0d9b906299054d6424de /src/types.cpp
parente9b9d15de7bc08bdf2891586589e215832c9a3cc (diff)
parent526a42c6caac9bc39b9217e58c297d084c3d694a (diff)
Merge pull request #1164 from odin-lang/llvm-explicit-padding
LLVM Struct Types with Explicit Padding
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 23834bfc1..7a5ea489b 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -2432,7 +2432,7 @@ Selection lookup_field_from_index(Type *type, i64 index) {
for (isize i = 0; i < max_count; i++) {
Entity *f = type->Struct.fields[i];
if (f->kind == Entity_Variable) {
- if (f->Variable.field_src_index == index) {
+ if (f->Variable.field_index == index) {
auto sel_array = array_make<i32>(a, 1);
sel_array[0] = cast(i32)i;
return make_selection(f, sel_array, false);
@@ -2972,7 +2972,7 @@ i64 type_align_of_internal(Type *t, TypePath *path) {
return 1;
}
if (t->Union.custom_align > 0) {
- return gb_clamp(t->Union.custom_align, 1, build_context.max_align);
+ return gb_max(t->Union.custom_align, 1);
}
i64 max = 1;
@@ -2993,7 +2993,7 @@ i64 type_align_of_internal(Type *t, TypePath *path) {
case Type_Struct: {
if (t->Struct.custom_align > 0) {
- return gb_clamp(t->Struct.custom_align, 1, build_context.max_align);
+ return gb_max(t->Struct.custom_align, 1);
}
if (t->Struct.is_raw_union) {
i64 max = 1;