fix that bounds check, it was stupid (< 0 = builtin)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 19 Aug 2009 06:21:14 +0000 (06:21 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 19 Aug 2009 06:21:14 +0000 (06:21 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9129 d7cf8633-e32d-0410-b094-e92efae38249

prvm_edict.c

index 718ac55..81ec29c 100644 (file)
@@ -1773,7 +1773,7 @@ void PRVM_LoadProgs (const char * filename, int numrequiredfunc, char **required
                prog->functions[i].numparms = LittleLong (dfunctions[i].numparms);
                prog->functions[i].locals = LittleLong (dfunctions[i].locals);
                memcpy(prog->functions[i].parm_size, dfunctions[i].parm_size, sizeof(dfunctions[i].parm_size));
-               if(prog->functions[i].first_statement < 0 || prog->functions[i].first_statement >= prog->progs->numstatements)
+               if(prog->functions[i].first_statement >= prog->progs->numstatements)
                        PRVM_ERROR("PRVM_LoadProgs: out of bounds function statement (function %d) in %s", i, PRVM_NAME);
                // TODO bounds check parm_start, s_name, s_file, numparms, locals, parm_size
        }