off by one error in computing tail jump offset

This commit is contained in:
Alex Shinn 2011-07-05 21:38:17 +09:00
parent 54d353375c
commit 5266d15004

2
vm.c
View file

@ -396,7 +396,7 @@ static void generate_tail_jump (sexp ctx, sexp name, sexp loc, sexp lam, sexp ap
/* jump */ /* jump */
emit(ctx, SEXP_OP_JUMP); emit(ctx, SEXP_OP_JUMP);
emit_word(ctx, (sexp_uint_t) (-sexp_context_pos(ctx) - 1 + emit_word(ctx, (sexp_uint_t) (-sexp_context_pos(ctx) +
(sexp_pairp(sexp_lambda_locals(lam)) (sexp_pairp(sexp_lambda_locals(lam))
? 1 + sizeof(sexp) : 0))); ? 1 + sizeof(sexp) : 0)));