mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
bugfix in the bytecode generator
This commit is contained in:
@@ -68,11 +68,11 @@ compileEquations gr arity st (i:is) eqs fl bs = whilePP eqs Map.empty
|
|||||||
(EFloat d) -> CASE_LIT (LFlt d)
|
(EFloat d) -> CASE_LIT (LFlt d)
|
||||||
|
|
||||||
compileBranch0 fl bs ((t,n),eqs) =
|
compileBranch0 fl bs ((t,n),eqs) =
|
||||||
let (bs1,instrs) = compileEquations gr arity (st+n) (push_is st n is) eqs fl bs
|
let (bs1,instrs) = compileEquations gr arity (st+n) (push_is (st+n-1) n is) eqs fl bs
|
||||||
in (bs1, case_instr t n (length bs1) : instrs)
|
in (bs1, case_instr t n (length bs1) : instrs)
|
||||||
|
|
||||||
compileBranch l bs ((t,n),eqs) =
|
compileBranch l bs ((t,n),eqs) =
|
||||||
let (bs1,instrs) = compileEquations gr arity (st+n) (push_is st n is) eqs fl ((case_instr t n (length bs1) : instrs) : bs)
|
let (bs1,instrs) = compileEquations gr arity (st+n) (push_is (st+n-1) n is) eqs fl ((case_instr t n (length bs1) : instrs) : bs)
|
||||||
in bs1
|
in bs1
|
||||||
|
|
||||||
mkFail st1 Nothing = FAIL
|
mkFail st1 Nothing = FAIL
|
||||||
|
|||||||
@@ -738,8 +738,8 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr,
|
|||||||
call_patch.ref = jump-6;
|
call_patch.ref = jump-6;
|
||||||
gu_buf_push(rdr->jit_state->call_patches, PgfCallPatch, call_patch);
|
gu_buf_push(rdr->jit_state->call_patches, PgfCallPatch, call_patch);
|
||||||
|
|
||||||
for (int i = 0; i < n; i++) {
|
for (int i = n; i > 0; i--) {
|
||||||
jit_ldxi_p(JIT_R0, JIT_VHEAP, sizeof(PgfValue)+sizeof(PgfClosure*)*i);
|
jit_ldxi_p(JIT_R0, JIT_VHEAP, sizeof(PgfValue)+sizeof(PgfClosure*)*(i-1));
|
||||||
jit_pushr_p(JIT_R0);
|
jit_pushr_p(JIT_R0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user