diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_ffrecord.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c index 39e80842..289c5775 100644 --- a/src/lj_ffrecord.c +++ b/src/lj_ffrecord.c | |||
| @@ -269,7 +269,7 @@ static void LJ_FASTCALL recff_tonumber(jit_State *J, RecordFFData *rd) | |||
| 269 | { | 269 | { |
| 270 | TRef tr = J->base[0]; | 270 | TRef tr = J->base[0]; |
| 271 | TRef base = J->base[1]; | 271 | TRef base = J->base[1]; |
| 272 | if (tr && base) { | 272 | if (tr && !tref_isnil(base)) { |
| 273 | base = lj_opt_narrow_toint(J, base); | 273 | base = lj_opt_narrow_toint(J, base); |
| 274 | if (!tref_isk(base) || IR(tref_ref(base))->i != 10) | 274 | if (!tref_isk(base) || IR(tref_ref(base))->i != 10) |
| 275 | recff_nyiu(J); | 275 | recff_nyiu(J); |
| @@ -693,7 +693,7 @@ static void LJ_FASTCALL recff_string_range(jit_State *J, RecordFFData *rd) | |||
| 693 | end = argv2int(J, &rd->argv[2]); | 693 | end = argv2int(J, &rd->argv[2]); |
| 694 | } | 694 | } |
| 695 | } else { /* string.byte(str, [,start [,end]]) */ | 695 | } else { /* string.byte(str, [,start [,end]]) */ |
| 696 | if (J->base[1]) { | 696 | if (!tref_isnil(J->base[1])) { |
| 697 | start = argv2int(J, &rd->argv[1]); | 697 | start = argv2int(J, &rd->argv[1]); |
| 698 | trstart = lj_opt_narrow_toint(J, J->base[1]); | 698 | trstart = lj_opt_narrow_toint(J, J->base[1]); |
| 699 | trend = J->base[2]; | 699 | trend = J->base[2]; |
| @@ -778,7 +778,7 @@ static void LJ_FASTCALL recff_string_rep(jit_State *J, RecordFFData *rd) | |||
| 778 | TRef str = lj_ir_tostr(J, J->base[0]); | 778 | TRef str = lj_ir_tostr(J, J->base[0]); |
| 779 | TRef rep = lj_opt_narrow_toint(J, J->base[1]); | 779 | TRef rep = lj_opt_narrow_toint(J, J->base[1]); |
| 780 | TRef hdr, tr, str2 = 0; | 780 | TRef hdr, tr, str2 = 0; |
| 781 | if (J->base[2]) { | 781 | if (!tref_isnil(J->base[2])) { |
| 782 | TRef sep = lj_ir_tostr(J, J->base[2]); | 782 | TRef sep = lj_ir_tostr(J, J->base[2]); |
| 783 | int32_t vrep = argv2int(J, &rd->argv[1]); | 783 | int32_t vrep = argv2int(J, &rd->argv[1]); |
| 784 | emitir(IRTGI(vrep > 1 ? IR_GT : IR_LE), rep, lj_ir_kint(J, 1)); | 784 | emitir(IRTGI(vrep > 1 ? IR_GT : IR_LE), rep, lj_ir_kint(J, 1)); |
