mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-23 03:01:30 +00:00
DEF_SAVEGLOBAL flag is now applied on initialized non-constant globals, and is not applied on 'consts'
This commit is contained in:
parent
6b4c89700b
commit
db5484bdef
1 changed files with 10 additions and 12 deletions
22
ir.c
22
ir.c
|
@ -3209,9 +3209,9 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
|
|||
vec_push(code_globals, *iptr);
|
||||
} else {
|
||||
vec_push(code_globals, 0);
|
||||
if (!islocal)
|
||||
def.type |= DEF_SAVEGLOBAL;
|
||||
}
|
||||
if (!islocal && global->cvq != CV_CONST)
|
||||
def.type |= DEF_SAVEGLOBAL;
|
||||
vec_push(code_defs, def);
|
||||
|
||||
return global->code.globaladdr >= 0;
|
||||
|
@ -3223,9 +3223,9 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
|
|||
vec_push(code_globals, code_genstring(global->constval.vstring));
|
||||
} else {
|
||||
vec_push(code_globals, 0);
|
||||
if (!islocal)
|
||||
def.type |= DEF_SAVEGLOBAL;
|
||||
}
|
||||
if (!islocal && global->cvq != CV_CONST)
|
||||
def.type |= DEF_SAVEGLOBAL;
|
||||
vec_push(code_defs, def);
|
||||
return global->code.globaladdr >= 0;
|
||||
}
|
||||
|
@ -3238,21 +3238,19 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
|
|||
vec_push(code_globals, iptr[0]);
|
||||
if (global->code.globaladdr < 0)
|
||||
return false;
|
||||
for (d = 1; d < type_sizeof[global->vtype]; ++d)
|
||||
{
|
||||
for (d = 1; d < type_sizeof[global->vtype]; ++d) {
|
||||
vec_push(code_globals, iptr[d]);
|
||||
}
|
||||
} else {
|
||||
vec_push(code_globals, 0);
|
||||
if (global->code.globaladdr < 0)
|
||||
return false;
|
||||
for (d = 1; d < type_sizeof[global->vtype]; ++d)
|
||||
{
|
||||
for (d = 1; d < type_sizeof[global->vtype]; ++d) {
|
||||
vec_push(code_globals, 0);
|
||||
}
|
||||
if (!islocal)
|
||||
def.type |= DEF_SAVEGLOBAL;
|
||||
}
|
||||
if (!islocal && global->cvq != CV_CONST)
|
||||
def.type |= DEF_SAVEGLOBAL;
|
||||
|
||||
vec_push(code_defs, def);
|
||||
return global->code.globaladdr >= 0;
|
||||
|
@ -3267,9 +3265,9 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc
|
|||
vec_push(code_globals, vec_size(code_functions));
|
||||
if (!gen_global_function(self, global))
|
||||
return false;
|
||||
if (!islocal)
|
||||
def.type |= DEF_SAVEGLOBAL;
|
||||
}
|
||||
if (!islocal && global->cvq != CV_CONST)
|
||||
def.type |= DEF_SAVEGLOBAL;
|
||||
vec_push(code_defs, def);
|
||||
return true;
|
||||
case TYPE_VARIANT:
|
||||
|
|
Loading…
Reference in a new issue