mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-19 15:30:50 +00:00
Adjust the offsets of ivars in derived classes.
As ivar structs are not independent, their starting offset is not necessarily zero (almost never will be for derived classes).
This commit is contained in:
parent
d66a441867
commit
1b8edc07c9
1 changed files with 7 additions and 0 deletions
|
@ -870,6 +870,13 @@ class_new_ivars (class_t *class)
|
|||
void
|
||||
class_add_ivars (class_t *class, symtab_t *ivars)
|
||||
{
|
||||
int base = 0;
|
||||
symbol_t *sym;
|
||||
|
||||
if (class->super_class)
|
||||
base = type_size (class->super_class->type);
|
||||
for (sym = ivars->symbols; sym; sym = sym->next)
|
||||
sym->s.offset += base;
|
||||
class->ivars = ivars;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue