mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 20:41:20 +00:00
Really nail down the args param in rua_obj_msg_sendv().
This commit is contained in:
parent
dbe0c763d5
commit
00e590f5f5
4 changed files with 10 additions and 7 deletions
|
@ -204,6 +204,9 @@ int PR_RunLoadFuncs (progs_t *pr);
|
|||
*/
|
||||
int PR_Check_Opcodes (progs_t *pr);
|
||||
|
||||
void PR_BoundsCheckSize (progs_t *pr, int addr, unsigned size);
|
||||
void PR_BoundsCheck (progs_t *pr, int addr, etype_t type);
|
||||
|
||||
//@}
|
||||
|
||||
/** \defgroup progs_edict Edict management
|
||||
|
|
|
@ -257,7 +257,7 @@ PR_LeaveFunction (progs_t *pr)
|
|||
&pr->localstack[pr->localstack_used], sizeof (pr_type_t) * c);
|
||||
}
|
||||
|
||||
static void
|
||||
VISIBLE void
|
||||
PR_BoundsCheckSize (progs_t *pr, int addr, unsigned size)
|
||||
{
|
||||
if (addr < 0 || addr >= pr->globals_size
|
||||
|
@ -266,7 +266,7 @@ PR_BoundsCheckSize (progs_t *pr, int addr, unsigned size)
|
|||
pr->globals_size, size);
|
||||
}
|
||||
|
||||
static void
|
||||
VISIBLE void
|
||||
PR_BoundsCheck (progs_t *pr, int addr, etype_t type)
|
||||
{
|
||||
PR_BoundsCheckSize (pr, addr, pr_type_size[type]);
|
||||
|
|
|
@ -55,7 +55,7 @@ static __attribute__ ((used)) const char rcsid[] =
|
|||
|
||||
#include "compat.h"
|
||||
|
||||
cvar_t *pr_boundscheck;
|
||||
VISIBLE cvar_t *pr_boundscheck;
|
||||
cvar_t *pr_deadbeef_ents;
|
||||
cvar_t *pr_deadbeef_locals;
|
||||
cvar_t *pr_faultchecks;
|
||||
|
|
|
@ -912,14 +912,14 @@ rua_obj_msg_sendv (progs_t *pr)
|
|||
int count = args->count;
|
||||
func_t imp = obj_msg_lookup (pr, receiver, op);
|
||||
|
||||
//FIXME bounds checking
|
||||
count = bound (0, count, 6);
|
||||
if (count && pr_boundscheck->int_val)
|
||||
PR_BoundsCheckSize (pr, args->list, count * pr->pr_param_size);
|
||||
if (!imp)
|
||||
PR_RunError (pr, "%s does not respond to %s",
|
||||
PR_GetString (pr, object_get_class_name (pr, receiver)),
|
||||
PR_GetString (pr, pr->selector_names[op->sel_id]));
|
||||
if (count > 6)
|
||||
count = 6;
|
||||
if (count > 0)
|
||||
if (count)
|
||||
memcpy (pr->pr_params[2], params, count * 4 * pr->pr_param_size);
|
||||
PR_CallFunction (pr, imp);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue