Compare commits

..

1 Commits

Author SHA1 Message Date
Aditya Bisht
d6eda47c5b
Merge bb784b48a6 into 538a82133a 2025-03-12 16:42:27 +08:00
6 changed files with 10 additions and 25 deletions

View File

@ -302,9 +302,6 @@ endif
ifneq (,$(INSTALL_LJLIBD)) ifneq (,$(INSTALL_LJLIBD))
TARGET_XCFLAGS+= -DLUA_LJDIR=\"$(INSTALL_LJLIBD)\" TARGET_XCFLAGS+= -DLUA_LJDIR=\"$(INSTALL_LJLIBD)\"
endif endif
ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null -fno-strict-float-cast-overflow 2>/dev/null || echo 1))
TARGET_XCFLAGS+= -fno-strict-float-cast-overflow
endif
############################################################################## ##############################################################################
# Target system detection. # Target system detection.

View File

@ -1927,7 +1927,7 @@ static void asm_hiop(ASMState *as, IRIns *ir)
} else if ((ir-1)->o == IR_MIN || (ir-1)->o == IR_MAX) { } else if ((ir-1)->o == IR_MIN || (ir-1)->o == IR_MAX) {
as->curins--; /* Always skip the loword min/max. */ as->curins--; /* Always skip the loword min/max. */
if (uselo || usehi) if (uselo || usehi)
asm_sfpmin_max(as, ir-1, (ir-1)->o == IR_MIN ? CC_HS : CC_LS); asm_sfpmin_max(as, ir-1, (ir-1)->o == IR_MIN ? CC_PL : CC_LE);
return; return;
#elif LJ_HASFFI #elif LJ_HASFFI
} else if ((ir-1)->o == IR_CONV) { } else if ((ir-1)->o == IR_CONV) {

View File

@ -781,24 +781,17 @@ static unsigned int ccall_classify_struct(CTState *cts, CType *ct)
{ {
CTSize sz = ct->size; CTSize sz = ct->size;
unsigned int r = 0, n = 0, isu = (ct->info & CTF_UNION); unsigned int r = 0, n = 0, isu = (ct->info & CTF_UNION);
while (ct->sib && n <= 4) { while (ct->sib) {
unsigned int m = 1;
CType *sct; CType *sct;
ct = ctype_get(cts, ct->sib); ct = ctype_get(cts, ct->sib);
if (ctype_isfield(ct->info)) { if (ctype_isfield(ct->info)) {
sct = ctype_rawchild(cts, ct); sct = ctype_rawchild(cts, ct);
if (ctype_isarray(sct->info)) {
CType *cct = ctype_rawchild(cts, sct);
if (!cct->size) continue;
m = sct->size / cct->size;
sct = cct;
}
if (ctype_isfp(sct->info)) { if (ctype_isfp(sct->info)) {
r |= sct->size; r |= sct->size;
if (!isu) n += m; else if (n < m) n = m; if (!isu) n++; else if (n == 0) n = 1;
} else if (ctype_iscomplex(sct->info)) { } else if (ctype_iscomplex(sct->info)) {
r |= (sct->size >> 1); r |= (sct->size >> 1);
if (!isu) n += 2*m; else if (n < 2*m) n = 2*m; if (!isu) n += 2; else if (n < 2) n = 2;
} else if (ctype_isstruct(sct->info)) { } else if (ctype_isstruct(sct->info)) {
goto substruct; goto substruct;
} else { } else {
@ -810,11 +803,10 @@ static unsigned int ccall_classify_struct(CTState *cts, CType *ct)
sct = ctype_rawchild(cts, ct); sct = ctype_rawchild(cts, ct);
substruct: substruct:
if (sct->size > 0) { if (sct->size > 0) {
unsigned int s = ccall_classify_struct(cts, sct), sn; unsigned int s = ccall_classify_struct(cts, sct);
if (s <= 1) goto noth; if (s <= 1) goto noth;
r |= (s & 255); r |= (s & 255);
sn = (s >> 8) * m; if (!isu) n += (s >> 8); else if (n < (s >>8)) n = (s >> 8);
if (!isu) n += sn; else if (n < sn) n = sn;
} }
} }
} }

View File

@ -122,9 +122,8 @@ LUALIB_API int luaL_loadfilex(lua_State *L, const char *filename,
copyTV(L, L->top-1, L->top); copyTV(L, L->top-1, L->top);
} }
if (err) { if (err) {
const char *fname = filename ? filename : "stdin";
L->top--; L->top--;
lua_pushfstring(L, "cannot read %s: %s", fname, strerror(err)); lua_pushfstring(L, "cannot read %s: %s", chunkname+1, strerror(err));
return LUA_ERRFILE; return LUA_ERRFILE;
} }
return status; return status;

View File

@ -1107,10 +1107,7 @@ int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm)
return 0; /* No metamethod. */ return 0; /* No metamethod. */
} }
/* The cdata metatable is treated as immutable. */ /* The cdata metatable is treated as immutable. */
if (LJ_HASFFI && tref_iscdata(ix->tab)) { if (LJ_HASFFI && tref_iscdata(ix->tab)) goto immutable_mt;
mix.tab = TREF_NIL;
goto immutable_mt;
}
ix->mt = mix.tab = lj_ir_ggfload(J, IRT_TAB, ix->mt = mix.tab = lj_ir_ggfload(J, IRT_TAB,
GG_OFS(g.gcroot[GCROOT_BASEMT+itypemap(&ix->tabv)])); GG_OFS(g.gcroot[GCROOT_BASEMT+itypemap(&ix->tabv)]));
goto nocheck; goto nocheck;

View File

@ -1717,8 +1717,8 @@ static void build_subroutines(BuildCtx *ctx)
|.endif |.endif
|.endmacro |.endmacro
| |
| math_minmax math_min, gt, hs | math_minmax math_min, gt, pl
| math_minmax math_max, lt, ls | math_minmax math_max, lt, le
| |
|//-- String library ----------------------------------------------------- |//-- String library -----------------------------------------------------
| |