diff options
-rw-r--r-- | src/lj_crecord.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lj_crecord.c b/src/lj_crecord.c index 73575fe2..a24c541e 100644 --- a/src/lj_crecord.c +++ b/src/lj_crecord.c | |||
@@ -984,11 +984,12 @@ void LJ_FASTCALL recff_ffi_copy(jit_State *J, RecordFFData *rd) | |||
984 | if (trlen) { | 984 | if (trlen) { |
985 | trlen = crec_toint(J, cts, trlen, &rd->argv[2]); | 985 | trlen = crec_toint(J, cts, trlen, &rd->argv[2]); |
986 | } else { | 986 | } else { |
987 | trlen = emitir(IRTI(IR_FLOAD), trsrc, IRFL_STR_LEN); | 987 | trlen = emitir(IRTI(IR_FLOAD), J->base[1], IRFL_STR_LEN); |
988 | trlen = emitir(IRTI(IR_ADD), trlen, lj_ir_kint(J, 1)); | 988 | trlen = emitir(IRTI(IR_ADD), trlen, lj_ir_kint(J, 1)); |
989 | } | 989 | } |
990 | lj_ir_call(J, IRCALL_memcpy, trdst, trsrc, trlen); | 990 | lj_ir_call(J, IRCALL_memcpy, trdst, trsrc, trlen); |
991 | emitir(IRT(IR_XBAR, IRT_NIL), 0, 0); | 991 | emitir(IRT(IR_XBAR, IRT_NIL), 0, 0); |
992 | rd->nres = 0; | ||
992 | } /* else: interpreter will throw. */ | 993 | } /* else: interpreter will throw. */ |
993 | } | 994 | } |
994 | 995 | ||
@@ -1005,6 +1006,7 @@ void LJ_FASTCALL recff_ffi_fill(jit_State *J, RecordFFData *rd) | |||
1005 | trfill = lj_ir_kint(J, 0); | 1006 | trfill = lj_ir_kint(J, 0); |
1006 | lj_ir_call(J, IRCALL_memset, tr, trfill, trlen); | 1007 | lj_ir_call(J, IRCALL_memset, tr, trfill, trlen); |
1007 | emitir(IRT(IR_XBAR, IRT_NIL), 0, 0); | 1008 | emitir(IRT(IR_XBAR, IRT_NIL), 0, 0); |
1009 | rd->nres = 0; | ||
1008 | } /* else: interpreter will throw. */ | 1010 | } /* else: interpreter will throw. */ |
1009 | } | 1011 | } |
1010 | 1012 | ||