mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-31 05:00:35 +00:00
Correctly calculate the size of the ivars of a class.
Need to include the size of the super class ivars.
This commit is contained in:
parent
690ae1cb57
commit
d03fdc5e67
1 changed files with 10 additions and 3 deletions
|
@ -861,9 +861,16 @@ type_size (type_t *type)
|
|||
case ty_union:
|
||||
return type->t.symtab->size;
|
||||
case ty_class:
|
||||
if (!type->t.class->ivars)
|
||||
return 0;
|
||||
return type->t.class->ivars->size;
|
||||
{
|
||||
class_t *class = type->t.class;
|
||||
int size;
|
||||
if (!class->ivars)
|
||||
return 0;
|
||||
size = class->ivars->size;
|
||||
if (class->super_class)
|
||||
size += type_size (class->super_class->type);
|
||||
return size;
|
||||
}
|
||||
case ty_array:
|
||||
return type->t.array.size * type_size (type->t.array.type);
|
||||
case ty_none:
|
||||
|
|
Loading…
Reference in a new issue