From 3b63c31b5d57d541f701fcfffe60b57c6c751a54 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 26 Dec 2012 11:47:53 +0900 Subject: [PATCH] Use pr_return for the null pointer check. The params come after the return slot :P. Getting a null pointer exception for movep from .return wasn't very funny. --- libs/gamecode/pr_exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/gamecode/pr_exec.c b/libs/gamecode/pr_exec.c index 03182e372..4ab985849 100644 --- a/libs/gamecode/pr_exec.c +++ b/libs/gamecode/pr_exec.c @@ -257,7 +257,7 @@ PR_LeaveFunction (progs_t *pr) VISIBLE void PR_BoundsCheckSize (progs_t *pr, pointer_t addr, unsigned size) { - if (addr < pr->pr_real_params[0] - pr->pr_globals) + if (addr < pr->pr_return - pr->pr_globals) PR_RunError (pr, "null pointer access"); if (addr >= pr->globals_size || size > (unsigned) (pr->globals_size - addr))