aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-10-10 21:24:32 +0100
committergingerBill <bill@gingerbill.org>2019-10-10 21:24:32 +0100
commit31391519353ba65e032cf6681d056cc7401557e3 (patch)
tree3fdcf1ed5a1acd1b62cf0dd7b5845761cec9da23 /src
parent672a8f5dbd101441b732abd2b3ec1c656fc4e30f (diff)
Minor fix to systemv_distribute_struct_fields
Diffstat (limited to 'src')
-rw-r--r--src/check_type.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/check_type.cpp b/src/check_type.cpp
index e4f3cbf0e..0d9722ad8 100644
--- a/src/check_type.cpp
+++ b/src/check_type.cpp
@@ -1837,9 +1837,9 @@ Type *check_get_results(CheckerContext *ctx, Scope *scope, Ast *_results) {
return tuple;
}
-Array<Type *> systemv_distribute_struct_fields(Type *t, i32 level=0) {
+Array<Type *> systemv_distribute_struct_fields(Type *t) {
t = base_type(t);
- GB_ASSERT_MSG(t->kind == Type_Struct, "%s %d", type_to_string(t), level);
+ GB_ASSERT_MSG(t->kind == Type_Struct, "%s", type_to_string(t));
TypeStruct *ts = &t->Struct;
auto distributed = array_make<Type *>(heap_allocator(), 0, ts->fields.count);
@@ -1865,11 +1865,7 @@ Array<Type *> systemv_distribute_struct_fields(Type *t, i32 level=0) {
array_add(&distributed, t_f32);
break;
case Basic_quaternion256:
- array_add(&distributed, t_f64);
- array_add(&distributed, t_f64);
- array_add(&distributed, t_f64);
- array_add(&distributed, t_f64);
- break;
+ goto DEFAULT;
case Basic_string:
array_add(&distributed, t_u8_ptr);
array_add(&distributed, t_int);
@@ -1887,6 +1883,8 @@ Array<Type *> systemv_distribute_struct_fields(Type *t, i32 level=0) {
} else {
array_add(&distributed, bt);
}
+ break;
+
default:
goto DEFAULT;
}
@@ -1898,7 +1896,7 @@ Array<Type *> systemv_distribute_struct_fields(Type *t, i32 level=0) {
} else {
// IMPORTANT TOOD(bill): handle #packed structs correctly
// IMPORTANT TODO(bill): handle #align structs correctly
- auto nested = systemv_distribute_struct_fields(f->type, level+1);
+ auto nested = systemv_distribute_struct_fields(f->type);
for_array(i, nested) {
array_add(&distributed, nested[i]);
}