From: cloudwalk Date: Sat, 28 Nov 2020 16:08:22 +0000 (+0000) Subject: prvm_execprogram: Compare against numglobals instead of numglobaldefs. This should... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=40ec2db012388a38d6e5c5a5dcd3871d3ad10bee;p=xonotic%2Fdarkplaces.git prvm_execprogram: Compare against numglobals instead of numglobaldefs. This should be correct... git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13050 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/prvm_execprogram.h b/prvm_execprogram.h index 7acd0cc8..a3128062 100644 --- a/prvm_execprogram.h +++ b/prvm_execprogram.h @@ -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);