diff options
| -rw-r--r-- | src/lj_ffrecord.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c index 151c4c8c..c70793a4 100644 --- a/src/lj_ffrecord.c +++ b/src/lj_ffrecord.c | |||
| @@ -1204,6 +1204,15 @@ static void LJ_FASTCALL recff_buffer_method_set(jit_State *J, RecordFFData *rd) | |||
| 1204 | if (tref_isstr(tr)) { | 1204 | if (tref_isstr(tr)) { |
| 1205 | TRef trp = emitir(IRT(IR_STRREF, IRT_PGC), tr, lj_ir_kint(J, 0)); | 1205 | TRef trp = emitir(IRT(IR_STRREF, IRT_PGC), tr, lj_ir_kint(J, 0)); |
| 1206 | TRef len = emitir(IRTI(IR_FLOAD), tr, IRFL_STR_LEN); | 1206 | TRef len = emitir(IRTI(IR_FLOAD), tr, IRFL_STR_LEN); |
| 1207 | IRIns *irp = IR(tref_ref(trp)); | ||
| 1208 | /* Anchor (potentially different) obj into which trp points after fold. */ | ||
| 1209 | if (irp->o == IR_STRREF) { | ||
| 1210 | tr = irp->op1; | ||
| 1211 | } else if (irp->o == IR_KKPTR && !tref_isk(tr)) { | ||
| 1212 | GCstr *str = strV(&rd->argv[1]); /* Constify the argument. */ | ||
| 1213 | tr = lj_ir_kstr(J, str); | ||
| 1214 | trp = lj_ir_kkptr(J, (char *)strdata(str)); | ||
| 1215 | } | ||
| 1207 | lj_ir_call(J, IRCALL_lj_bufx_set, trbuf, trp, len, tr); | 1216 | lj_ir_call(J, IRCALL_lj_bufx_set, trbuf, trp, len, tr); |
| 1208 | #if LJ_HASFFI | 1217 | #if LJ_HASFFI |
| 1209 | } else if (tref_iscdata(tr)) { | 1218 | } else if (tref_iscdata(tr)) { |
