diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h index 5b83e34d..2f64f491 100644 --- a/src/lj_asm_mips.h +++ b/src/lj_asm_mips.h @@ -456,7 +456,7 @@ static void asm_retf(ASMState *as, IRIns *ir) emit_addptr(as, base, -8*delta); asm_guard(as, MIPSI_BNE, RID_TMP, ra_allock(as, igcptr(pc), rset_exclude(RSET_GPR, base))); - emit_tsi(as, MIPSI_AL, RID_TMP, base, -8); + emit_tsi(as, MIPSI_AL, RID_TMP, base, (LJ_BE || LJ_FR2) ? -8 : -4); } /* -- Buffer operations --------------------------------------------------- */ diff --git a/src/lj_gc.c b/src/lj_gc.c index 9cabdef0..69e78706 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c @@ -604,12 +604,11 @@ void lj_gc_finalize_cdata(lua_State *L) /* Free all remaining GC objects. */ void lj_gc_freeall(global_State *g) { - MSize i, strmask; + MSize i; /* Free everything, except super-fixed objects (the main thread). */ g->gc.currentwhite = LJ_GC_WHITES | LJ_GC_SFIXED; gc_fullsweep(g, &g->gc.root); - strmask = g->str.mask; - for (i = 0; i <= strmask; i++) /* Free all string hash chains. */ + for (i = g->str.mask; i != ~(MSize)0; i--) /* Free all string hash chains. */ gc_sweepstr(g, &g->str.tab[i]); } diff --git a/src/lj_load.c b/src/lj_load.c index 152ef6da..fa6ed5bf 100644 --- a/src/lj_load.c +++ b/src/lj_load.c @@ -102,12 +102,13 @@ LUALIB_API int luaL_loadfilex(lua_State *L, const char *filename, int status; const char *chunkname; if (filename) { + chunkname = lua_pushfstring(L, "@%s", filename); ctx.fp = fopen(filename, "rb"); if (ctx.fp == NULL) { + L->top--; lua_pushfstring(L, "cannot open %s: %s", filename, strerror(errno)); return LUA_ERRFILE; } - chunkname = lua_pushfstring(L, "@%s", filename); } else { ctx.fp = stdin; chunkname = "=stdin";