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.
This commit is contained in:
Bill Currie 2012-12-26 11:47:53 +09:00
parent 386a729209
commit 3b63c31b5d

View file

@ -257,7 +257,7 @@ PR_LeaveFunction (progs_t *pr)
VISIBLE void VISIBLE void
PR_BoundsCheckSize (progs_t *pr, pointer_t addr, unsigned size) 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"); PR_RunError (pr, "null pointer access");
if (addr >= pr->globals_size if (addr >= pr->globals_size
|| size > (unsigned) (pr->globals_size - addr)) || size > (unsigned) (pr->globals_size - addr))