Fix the jump instruction.

The offset to compensate for st++ was missing.

Obviously, the code has never been tested.  Found while looking at the
jump code and thinking about using 32-bit addresses for the jump tables.
This commit is contained in:
Bill Currie 2013-06-26 09:59:19 +09:00
parent fd1ea9e00e
commit 99a8e8f228

View file

@ -893,7 +893,7 @@ PR_ExecuteProgram (progs_t * pr, func_t fnum)
&& (OPA.uinteger_var >= pr->progs->numstatements)) { && (OPA.uinteger_var >= pr->progs->numstatements)) {
PR_RunError (pr, "Invalid jump destination"); PR_RunError (pr, "Invalid jump destination");
} }
pr->pr_xstatement = OPA.uinteger_var; pr->pr_xstatement = OPA.uinteger_var - 1; // offset the st++
st = pr->pr_statements + pr->pr_xstatement; st = pr->pr_statements + pr->pr_xstatement;
break; break;
case OP_JUMPB: case OP_JUMPB: