Compare commits
10 Commits
ab834de8b6
...
659a61693a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
659a61693a | ||
|
|
89f268b3f7 | ||
|
|
a553b3de24 | ||
|
|
fc3d17eb40 | ||
|
|
02e2999558 | ||
|
|
1c3b5a4d72 | ||
|
|
26fd1a7d67 | ||
|
|
5db4b03aea | ||
|
|
233ad24035 | ||
|
|
54cce2e171 |
@@ -468,6 +468,8 @@ otherwise. The following parameters are currently defined:
|
||||
<td class="abiparam">uwp</td><td class="abidesc">Universal Windows Platform</td></tr>
|
||||
<tr class="even">
|
||||
<td class="abiparam">gc64</td><td class="abidesc">64 bit GC references</td></tr>
|
||||
<tr class="odd">
|
||||
<td class="abiparam">dualnum</td><td class="abidesc">Dual-number mode</td></tr>
|
||||
</table>
|
||||
|
||||
<h3 id="ffi_os"><tt>ffi.os</tt></h3>
|
||||
|
||||
@@ -758,6 +758,9 @@ LJLIB_CF(ffi_abi) LJLIB_REC(.)
|
||||
#endif
|
||||
#if LJ_GC64
|
||||
"\004gc64"
|
||||
#endif
|
||||
#if LJ_DUALNUM
|
||||
"\007dualnum"
|
||||
#endif
|
||||
) >= 0;
|
||||
setboolV(L->top-1, b);
|
||||
|
||||
@@ -81,7 +81,7 @@ static const char *clib_extname(lua_State *L, const char *name)
|
||||
/* Check for a recognized ld script line. */
|
||||
static const char *clib_check_lds(lua_State *L, const char *buf)
|
||||
{
|
||||
char *p, *e;
|
||||
const char *p, *e;
|
||||
if ((!strncmp(buf, "GROUP", 5) || !strncmp(buf, "INPUT", 5)) &&
|
||||
(p = strchr(buf, '('))) {
|
||||
while (*++p == ' ') ;
|
||||
|
||||
@@ -895,6 +895,8 @@ again:
|
||||
}
|
||||
J->base[0] = lj_ir_kint(J, (int32_t)fct->size);
|
||||
return; /* Interpreter will throw for newindex. */
|
||||
} else if (cd && cd->ctypeid == CTID_CTYPEID) {
|
||||
/* Only resolve constants and metamethods for constructors. */
|
||||
} else if (ctype_isbitfield(fct->info)) {
|
||||
if (ofs)
|
||||
ptr = emitir(IRT(IR_ADD, IRT_PTR), ptr, lj_ir_kintp(J, ofs));
|
||||
|
||||
@@ -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);
|
||||
if (rd->data) { /* Return string.sub result. */
|
||||
if (end - start >= 0) {
|
||||
if (start <= end) {
|
||||
/* Also handle empty range here, to avoid extra traces. */
|
||||
TRef trptr, trslen = emitir(IRTGI(IR_SUBOV), trend, trstart);
|
||||
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);
|
||||
}
|
||||
} else { /* Return string.byte result(s). */
|
||||
if (start < end) {
|
||||
ptrdiff_t i, len = end - start;
|
||||
if (len > 0) {
|
||||
TRef trslen = emitir(IRTGI(IR_SUBOV), trend, trstart);
|
||||
emitir(IRTGI(IR_EQ), trslen, lj_ir_kint(J, (int32_t)len));
|
||||
if (J->baseslot + len > LJ_MAX_JSLOTS)
|
||||
|
||||
@@ -526,6 +526,12 @@ static LoopEvent rec_for(jit_State *J, const BCIns *fori, int isforl)
|
||||
LoopEvent ev;
|
||||
TRef stop;
|
||||
IRType t;
|
||||
/* Avoid semantic mismatches and always failing guards. */
|
||||
if ((tvisnum(&tv[FORL_IDX]) && tvisnan(&tv[FORL_IDX])) ||
|
||||
(tvisnum(&tv[FORL_STOP]) && tvisnan(&tv[FORL_STOP])) ||
|
||||
(tvisnum(&tv[FORL_STEP]) && tvisnan(&tv[FORL_STEP])) ||
|
||||
tvismzero(&tv[FORL_STEP]))
|
||||
lj_trace_err(J, LJ_TRERR_GFAIL);
|
||||
if (isforl) { /* Handle FORL/JFORL opcodes. */
|
||||
TRef idx = tr[FORL_IDX];
|
||||
if (mref(J->scev.pc, const BCIns) == fori && tref_ref(idx) == J->scev.idx) {
|
||||
|
||||
@@ -72,7 +72,7 @@ static void resizestack(lua_State *L, MSize n)
|
||||
while (oldsize < realsize) /* Clear new slots. */
|
||||
setnilV(st + oldsize++);
|
||||
L->stacksize = realsize;
|
||||
if ((size_t)(mref(G(L)->jit_base, char) - (char *)oldst) < oldsize)
|
||||
if ((size_t)(mref(G(L)->jit_base, char) - (char *)oldst) < (size_t)oldsize * sizeof(TValue))
|
||||
setmref(G(L)->jit_base, mref(G(L)->jit_base, char) + delta);
|
||||
L->base = (TValue *)((char *)L->base + delta);
|
||||
L->top = (TValue *)((char *)L->top + delta);
|
||||
|
||||
Reference in New Issue
Block a user