Stores result of function QC_RegisterFieldVar in a local variable before storing it
into the global "field[fnum].ofs" because QC_RegisterFieldVar might change that global, and GCC reads the address of the global before the function call. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1037 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
ca93cb6b8f
commit
c4b668079c
1 changed files with 2 additions and 1 deletions
|
@ -247,7 +247,8 @@ int QC_RegisterFieldVar(progfuncs_t *progfuncs, unsigned int type, char *name, i
|
||||||
|
|
||||||
n=PRHunkAlloc(progfuncs, namelen);
|
n=PRHunkAlloc(progfuncs, namelen);
|
||||||
sprintf(n, "%s_x", name);
|
sprintf(n, "%s_x", name);
|
||||||
field[fnum].ofs = ofs = QC_RegisterFieldVar(progfuncs, ev_float, n, requestedpos, -1);
|
ofs = QC_RegisterFieldVar(progfuncs, ev_float, n, requestedpos, -1);
|
||||||
|
field[fnum].ofs = ofs;
|
||||||
|
|
||||||
n=PRHunkAlloc(progfuncs, namelen);
|
n=PRHunkAlloc(progfuncs, namelen);
|
||||||
sprintf(n, "%s_y", name);
|
sprintf(n, "%s_y", name);
|
||||||
|
|
Loading…
Reference in a new issue