mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Correct the emission of meta class ivars.
type_obj_class is no longer a class, so its ivars are not stored in type_obj_class.t.class->ivars but rather type_obj_class.t.symtab. This fixes the segfault Spirit and Randy were experiencing. In passing, correct the unneeded emission of meta class ivars for non-root classes. This should make for much smaller progs that use classes.
This commit is contained in:
parent
831f84a47b
commit
6a3c775270
1 changed files with 9 additions and 2 deletions
|
@ -642,8 +642,15 @@ begin_class (class_t *class)
|
|||
EMIT_STRING (space, meta->name, class->name);
|
||||
meta->info = _PR_CLS_META;
|
||||
meta->instance_size = type_size (&type_obj_class);
|
||||
EMIT_DEF (space, meta->ivars,
|
||||
emit_ivars (type_obj_class.t.class->ivars, "Class"));
|
||||
if (!class->super_class) {
|
||||
// The ivars list for the meta class struct get emitted only for the
|
||||
// root class of the hierachy.
|
||||
// NOTE: type_obj_class is not actually a class
|
||||
EMIT_DEF (space, meta->ivars,
|
||||
emit_ivars (type_obj_class.t.symtab, "Class"));
|
||||
} else {
|
||||
meta->ivars = 0;
|
||||
}
|
||||
current_class = &class->class_type;
|
||||
sym = class_symbol (current_class, 0);
|
||||
class->def = def = sym->s.def;
|
||||
|
|
Loading…
Reference in a new issue