Merge branch 'master' into v2.1
This commit is contained in:
@@ -854,7 +854,7 @@ static void LJ_FASTCALL recff_string_range(jit_State *J, RecordFFData *rd)
|
|||||||
}
|
}
|
||||||
trstart = recff_string_start(J, str, &start, trstart, trlen, tr0);
|
trstart = recff_string_start(J, str, &start, trstart, trlen, tr0);
|
||||||
if (rd->data) { /* Return string.sub result. */
|
if (rd->data) { /* Return string.sub result. */
|
||||||
if (end - start >= 0) {
|
if (start <= end) {
|
||||||
/* Also handle empty range here, to avoid extra traces. */
|
/* Also handle empty range here, to avoid extra traces. */
|
||||||
TRef trptr, trslen = emitir(IRTGI(IR_SUBOV), trend, trstart);
|
TRef trptr, trslen = emitir(IRTGI(IR_SUBOV), trend, trstart);
|
||||||
emitir(IRTGI(IR_GE), trslen, tr0);
|
emitir(IRTGI(IR_GE), trslen, tr0);
|
||||||
@@ -865,8 +865,8 @@ static void LJ_FASTCALL recff_string_range(jit_State *J, RecordFFData *rd)
|
|||||||
J->base[0] = lj_ir_kstr(J, &J2G(J)->strempty);
|
J->base[0] = lj_ir_kstr(J, &J2G(J)->strempty);
|
||||||
}
|
}
|
||||||
} else { /* Return string.byte result(s). */
|
} else { /* Return string.byte result(s). */
|
||||||
|
if (start < end) {
|
||||||
ptrdiff_t i, len = end - start;
|
ptrdiff_t i, len = end - start;
|
||||||
if (len > 0) {
|
|
||||||
TRef trslen = emitir(IRTGI(IR_SUBOV), trend, trstart);
|
TRef trslen = emitir(IRTGI(IR_SUBOV), trend, trstart);
|
||||||
emitir(IRTGI(IR_EQ), trslen, lj_ir_kint(J, (int32_t)len));
|
emitir(IRTGI(IR_EQ), trslen, lj_ir_kint(J, (int32_t)len));
|
||||||
if (J->baseslot + len > LJ_MAX_JSLOTS)
|
if (J->baseslot + len > LJ_MAX_JSLOTS)
|
||||||
|
|||||||
Reference in New Issue
Block a user