diff options
author | Mike Pall <mike> | 2025-01-13 16:22:22 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2025-01-13 16:22:22 +0100 |
commit | a4f56a459a588ae768801074b46ba0adcfb49eb1 (patch) | |
tree | 0fd10f7df370e7cb5342419092a9ca566eed7f92 | |
parent | 8358eb0cceb0aab0ba2872afa4a68ef391093d88 (diff) | |
parent | 62e362afbb1d100c892d2782c5862ad18bc464f2 (diff) | |
download | luajit-a4f56a459a588ae768801074b46ba0adcfb49eb1.tar.gz luajit-a4f56a459a588ae768801074b46ba0adcfb49eb1.tar.bz2 luajit-a4f56a459a588ae768801074b46ba0adcfb49eb1.zip |
Merge branch 'master' into v2.1
-rw-r--r-- | src/lib_base.c | 4 | ||||
-rw-r--r-- | src/lj_record.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/lib_base.c b/src/lib_base.c index c1847ec3..5d1b88a9 100644 --- a/src/lib_base.c +++ b/src/lib_base.c | |||
@@ -146,6 +146,8 @@ LJLIB_CF(getfenv) LJLIB_REC(.) | |||
146 | cTValue *o = L->base; | 146 | cTValue *o = L->base; |
147 | if (!(o < L->top && tvisfunc(o))) { | 147 | if (!(o < L->top && tvisfunc(o))) { |
148 | int level = lj_lib_optint(L, 1, 1); | 148 | int level = lj_lib_optint(L, 1, 1); |
149 | if (level < 0) | ||
150 | lj_err_arg(L, 1, LJ_ERR_INVLVL); | ||
149 | o = lj_debug_frame(L, level, &level); | 151 | o = lj_debug_frame(L, level, &level); |
150 | if (o == NULL) | 152 | if (o == NULL) |
151 | lj_err_arg(L, 1, LJ_ERR_INVLVL); | 153 | lj_err_arg(L, 1, LJ_ERR_INVLVL); |
@@ -168,6 +170,8 @@ LJLIB_CF(setfenv) | |||
168 | setgcref(L->env, obj2gco(t)); | 170 | setgcref(L->env, obj2gco(t)); |
169 | return 0; | 171 | return 0; |
170 | } | 172 | } |
173 | if (level < 0) | ||
174 | lj_err_arg(L, 1, LJ_ERR_INVLVL); | ||
171 | o = lj_debug_frame(L, level, &level); | 175 | o = lj_debug_frame(L, level, &level); |
172 | if (o == NULL) | 176 | if (o == NULL) |
173 | lj_err_arg(L, 1, LJ_ERR_INVLVL); | 177 | lj_err_arg(L, 1, LJ_ERR_INVLVL); |
diff --git a/src/lj_record.c b/src/lj_record.c index f908dd7f..38c180e8 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -2007,7 +2007,7 @@ static void rec_varg(jit_State *J, BCReg dst, ptrdiff_t nresults) | |||
2007 | J->maxslot = dst + (BCReg)nresults; | 2007 | J->maxslot = dst + (BCReg)nresults; |
2008 | } | 2008 | } |
2009 | } else if (select_detect(J)) { /* y = select(x, ...) */ | 2009 | } else if (select_detect(J)) { /* y = select(x, ...) */ |
2010 | TRef tridx = J->base[dst-1]; | 2010 | TRef tridx = getslot(J, dst-1); |
2011 | TRef tr = TREF_NIL; | 2011 | TRef tr = TREF_NIL; |
2012 | ptrdiff_t idx = lj_ffrecord_select_mode(J, tridx, &J->L->base[dst-1]); | 2012 | ptrdiff_t idx = lj_ffrecord_select_mode(J, tridx, &J->L->base[dst-1]); |
2013 | if (idx < 0) goto nyivarg; | 2013 | if (idx < 0) goto nyivarg; |