handle "return 0" a bit better. assumes location is is always 0, but it

always has been (and always /should/ be anyway:)
This commit is contained in:
Bill Currie 2003-08-13 17:27:34 +00:00
parent 28e2679f0b
commit fe3b544528

View file

@ -690,7 +690,10 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
break;
case OP_DONE:
case OP_RETURN:
if (&R_INT (pr) != &OPA.integer_var)
if (!st->a)
memset (&R_INT (pr), 0,
pr->pr_param_size * sizeof (OPA));
else if (&R_INT (pr) != &OPA.integer_var)
memcpy (&R_INT (pr), &OPA,
pr->pr_param_size * sizeof (OPA));
PR_LeaveFunction (pr);