Fix line error printing for error messages

This commit is contained in:
gingerBill
2023-06-19 22:12:47 +01:00
parent 427f212170
commit 6568625dea
7 changed files with 770 additions and 88 deletions

View File

@@ -3326,6 +3326,9 @@ gb_internal bool are_struct_fields_reordered(Type *type) {
type = base_type(type);
GB_ASSERT(type->kind == Type_Struct);
type_set_offsets(type);
if (type->Struct.fields.count == 0) {
return false;
}
GB_ASSERT(type->Struct.offsets != nullptr);
i64 prev_offset = 0;
@@ -3344,6 +3347,9 @@ gb_internal Slice<i32> struct_fields_index_by_increasing_offset(gbAllocator allo
type = base_type(type);
GB_ASSERT(type->kind == Type_Struct);
type_set_offsets(type);
if (type->Struct.fields.count == 0) {
return {};
}
GB_ASSERT(type->Struct.offsets != nullptr);
auto indices = slice_make<i32>(allocator, type->Struct.fields.count);