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
1 changed files with 1 additions and 1 deletions

View File

@ -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))