diff options
author | Mike Pall <mike> | 2010-10-11 21:52:22 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2010-10-11 21:52:22 +0200 |
commit | 5391a5f5b19b5b8713a12b3ccc3a8257e87317b7 (patch) | |
tree | bf57343a00b3af15bef45965d0f1e0832681f305 /src/lj_record.c | |
parent | b3cf2c70f4250c80408399c591743e7b6667b840 (diff) | |
download | luajit-5391a5f5b19b5b8713a12b3ccc3a8257e87317b7.tar.gz luajit-5391a5f5b19b5b8713a12b3ccc3a8257e87317b7.tar.bz2 luajit-5391a5f5b19b5b8713a12b3ccc3a8257e87317b7.zip |
Fix recording of y = select(n, ...) for non-int indexes.
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index 00cdcfe6..734adcf5 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -2015,6 +2015,8 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults) | |||
2015 | TRef tr = TREF_NIL; | 2015 | TRef tr = TREF_NIL; |
2016 | ptrdiff_t idx = select_mode(J, tridx, &J->L->base[dst-1]); | 2016 | ptrdiff_t idx = select_mode(J, tridx, &J->L->base[dst-1]); |
2017 | if (idx < 0) goto nyivarg; | 2017 | if (idx < 0) goto nyivarg; |
2018 | if (idx != 0 && !tref_isinteger(tridx)) | ||
2019 | tridx = emitir(IRTGI(IR_TOINT), tridx, IRTOINT_INDEX); | ||
2018 | if (idx != 0 && tref_isk(tridx)) { | 2020 | if (idx != 0 && tref_isk(tridx)) { |
2019 | emitir(IRTGI(idx <= nvararg ? IR_GE : IR_LT), | 2021 | emitir(IRTGI(idx <= nvararg ? IR_GE : IR_LT), |
2020 | fr, lj_ir_kint(J, frofs+8*(int32_t)idx)); | 2022 | fr, lj_ir_kint(J, frofs+8*(int32_t)idx)); |