From 8a20cb3a7052fab081681cdb3afa049f9a0b8ccc Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 19 Jul 2020 16:00:31 +0000 Subject: [PATCH] Annonymous union/struct fields were not initialising their symbol data properly for vector types. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5735 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_pr_comp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/qclib/qcc_pr_comp.c b/engine/qclib/qcc_pr_comp.c index 229a4c44d..9f22da8ae 100644 --- a/engine/qclib/qcc_pr_comp.c +++ b/engine/qclib/qcc_pr_comp.c @@ -15143,7 +15143,7 @@ static QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, QCC_function_t *scope, { char array[64]; char newname[256]; - int a, parms; + int a, parms, o; QCC_def_t *def, *first=NULL; unsigned int maxfield, startfield; QCC_type_t *ftype; @@ -15209,7 +15209,8 @@ static QCC_def_t *QCC_PR_DummyFieldDef(QCC_type_t *type, QCC_function_t *scope, def = QCC_PR_GetDef(ftype, newname, scope, true, 0, saved); if (parttype->type == ev_function) def->initialized = true; - def->symboldata[0]._int = *fieldofs; + for (o = 0; o < parttype->size; o++) + def->symboldata[o]._int = *fieldofs + o; *fieldofs += parttype->size; } else