mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
[qfcc] Pre-initialize type_object's strct pointer
This ensures that pointers to incomplete struct types are not misidentified as id before the class system has been initialized.
This commit is contained in:
parent
498dfdbfef
commit
643711ef40
1 changed files with 4 additions and 2 deletions
|
@ -89,8 +89,10 @@ type_t type_moduleptr = { ev_pointer, 0, 1, ty_basic, {{&type_module}}};
|
|||
type_t *obj_exec_class_params[] = { &type_moduleptr };
|
||||
type_t type_exec_class = { ev_func, 0, 1, ty_basic,
|
||||
{{&type_void, 1, obj_exec_class_params}}};
|
||||
|
||||
type_t type_object = {ev_invalid, 0, 0, ty_struct};
|
||||
// the cast of 1 in the init is to ensure pointers to incomplete types
|
||||
// are never misidentified as id. It will be set to the correct value
|
||||
// when the obj system is initialized.
|
||||
type_t type_object = {ev_invalid, 0, 0, ty_struct, {{(type_t *)1}}};
|
||||
type_t type_id = { ev_pointer, "id", 1, ty_basic, {{&type_object}}};
|
||||
type_t type_class = { ev_invalid, 0, 0, ty_struct};
|
||||
type_t type_Class = { ev_pointer, 0, 1, ty_basic, {{&type_class}}};
|
||||
|
|
Loading…
Reference in a new issue