mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-01-31 04:30:38 +00:00
Fix qcc crash.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5874 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
08b5b09fd3
commit
148de2e082
1 changed files with 13 additions and 2 deletions
|
@ -16856,8 +16856,19 @@ static pbool QCC_PR_GenerateInitializerType(QCC_def_t *basedef, QCC_sref_t tmp,
|
|||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; (unsigned)i < type->size; i++)
|
||||
def.sym->symboldata[def.ofs+i]._int = tmp.sym->symboldata[tmp.ofs+i]._int;
|
||||
const int *srcdata = (const void*)QCC_SRef_EvalConst(tmp);
|
||||
if (!srcdata)
|
||||
{
|
||||
QCC_PR_ParseWarning(WARN_NOTCONSTANT, "initializer is not initialised yet, %s will be treated as 0", QCC_GetSRefName(tmp));
|
||||
QCC_PR_ParsePrintSRef(WARN_NOTCONSTANT, tmp);
|
||||
for (i = 0; (unsigned)i < type->size; i++)
|
||||
def.sym->symboldata[def.ofs+i]._int = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; (unsigned)i < type->size; i++)
|
||||
def.sym->symboldata[def.ofs+i]._int = srcdata[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue