]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
fix the broken vector instructions in our executor as well... how could I forget
authorWolfgang Bumiller <blub@speed.at>
Mon, 14 Jan 2013 13:22:02 +0000 (14:22 +0100)
committerWolfgang Bumiller <blub@speed.at>
Mon, 14 Jan 2013 13:22:02 +0000 (14:22 +0100)
exec.c

diff --git a/exec.c b/exec.c
index 7a6322be5d3a75bcd0ed4ea298d30cff7e1561f1..f4c9ecf458f1a5a21d3247ad5f6ffee121d993fc 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -1282,15 +1282,21 @@ while (1) {
                           OPA->vector[2]*OPB->vector[2];
             break;
         case INSTR_MUL_FV:
-            OPC->vector[0] = OPA->_float * OPB->vector[0];
-            OPC->vector[1] = OPA->_float * OPB->vector[1];
-            OPC->vector[2] = OPA->_float * OPB->vector[2];
+        {
+            qcfloat f = OPA->_float;
+            OPC->vector[0] = f * OPB->vector[0];
+            OPC->vector[1] = f * OPB->vector[1];
+            OPC->vector[2] = f * OPB->vector[2];
             break;
+        }
         case INSTR_MUL_VF:
-            OPC->vector[0] = OPB->_float * OPA->vector[0];
-            OPC->vector[1] = OPB->_float * OPA->vector[1];
-            OPC->vector[2] = OPB->_float * OPA->vector[2];
+        {
+            qcfloat f = OPB->_float;
+            OPC->vector[0] = f * OPA->vector[0];
+            OPC->vector[1] = f * OPA->vector[1];
+            OPC->vector[2] = f * OPA->vector[2];
             break;
+        }
         case INSTR_DIV_F:
             if (OPB->_float != 0.0f)
                 OPC->_float = OPA->_float / OPB->_float;
@@ -1396,9 +1402,10 @@ while (1) {
                 goto cleanup;
             }
             ed = prog_getedict(prog, OPA->edict);
-            OPC->ivector[0] = ((qcany*)( ((qcint*)ed) + OPB->_int ))->ivector[0];
-            OPC->ivector[1] = ((qcany*)( ((qcint*)ed) + OPB->_int ))->ivector[1];
-            OPC->ivector[2] = ((qcany*)( ((qcint*)ed) + OPB->_int ))->ivector[2];
+            ptr = (qcany*)( ((qcint*)ed) + OPB->_int );
+            OPC->ivector[0] = ptr->ivector[0];
+            OPC->ivector[1] = ptr->ivector[1];
+            OPC->ivector[2] = ptr->ivector[2];
             break;
 
         case INSTR_ADDRESS: