From f4dc2c0b6e63807d4c7e18383b348534d597aef5 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Tue, 14 Oct 2014 09:27:24 +0000 Subject: bugfix in the bytecode generator --- src/runtime/c/pgf/jit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/runtime') diff --git a/src/runtime/c/pgf/jit.c b/src/runtime/c/pgf/jit.c index ab8eae1c6..c97113b5a 100644 --- a/src/runtime/c/pgf/jit.c +++ b/src/runtime/c/pgf/jit.c @@ -738,8 +738,8 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr, call_patch.ref = jump-6; gu_buf_push(rdr->jit_state->call_patches, PgfCallPatch, call_patch); - for (int i = 0; i < n; i++) { - jit_ldxi_p(JIT_R0, JIT_VHEAP, sizeof(PgfValue)+sizeof(PgfClosure*)*i); + for (int i = n; i > 0; i--) { + jit_ldxi_p(JIT_R0, JIT_VHEAP, sizeof(PgfValue)+sizeof(PgfClosure*)*(i-1)); jit_pushr_p(JIT_R0); } break; -- cgit v1.2.3