From c4b668079c7aeada54bbcb1edc39e36b61993e98 Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Thu, 19 May 2005 21:55:55 +0000 Subject: [PATCH] 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 --- engine/qclib/pr_multi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/qclib/pr_multi.c b/engine/qclib/pr_multi.c index 23a349539..8ec565b76 100644 --- a/engine/qclib/pr_multi.c +++ b/engine/qclib/pr_multi.c @@ -247,7 +247,8 @@ int QC_RegisterFieldVar(progfuncs_t *progfuncs, unsigned int type, char *name, i n=PRHunkAlloc(progfuncs, namelen); 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); sprintf(n, "%s_y", name);