]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
prvm_execprogram: Compare against numglobals instead of numglobaldefs. This should...
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 28 Nov 2020 16:08:22 +0000 (16:08 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 28 Nov 2020 16:08:22 +0000 (16:08 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13050 d7cf8633-e32d-0410-b094-e92efae38249

prvm_execprogram.h

index 7acd0cc81bacadf1b847fecc83fe93a357cf551e..a31280627560d4916011a2462fd28873e10ae9cc 100644 (file)
@@ -1020,8 +1020,7 @@ int i;
                        HANDLE_OPCODE(OP_GLOAD_ENT):
                        HANDLE_OPCODE(OP_GLOAD_S):
                        HANDLE_OPCODE(OP_GLOAD_FNC):
-                               // FIXME?: Is this correct?             vvvvvvvvvvvvv
-                               if (OPA->_int < 0 || OPA->_int >= prog->numglobaldefs)
+                               if (OPA->_int < 0 || OPA->_int >= prog->numglobals)
                                {
                                        PRE_ERROR();
                                        prog->error_cmd("%s Progs attempted to read an invalid indexed global", prog->name);
@@ -1031,8 +1030,7 @@ int i;
                                DISPATCH_OPCODE();
 
                        HANDLE_OPCODE(OP_GLOAD_V):
-                               // FIXME?: Is this correct?                 vvvvvvvvvvvvv
-                               if (OPA->_int < 0 || OPA->_int + 2 >= prog->numglobaldefs)
+                               if (OPA->_int < 0 || OPA->_int + 2 >= prog->numglobals)
                                {
                                        PRE_ERROR();
                                        prog->error_cmd("%s Progs attempted to read an invalid indexed global", prog->name);