diff --git a/CMakeLists.txt b/CMakeLists.txt index 52ae42a9..a200eaec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ option(LUAJIT_DISABLE_JIT "Disable JIT." OFF) option(LUAJIT_CPU_SSE2 "Use SSE2 instead of x87 instructions." ON) option(LUAJIT_CPU_NOCMOV "Disable NOCMOV." OFF) option(LUAJIT_DISABLE_GC64 "Disable GC64" OFF) -option(LUAJIT_ENABLE_FSANITIZE "Enable fsanitize" ON) +option(LUAJIT_ENABLE_FSANITIZE "Enable fsanitize" OFF) option(LUAJIT_NUMMODE "num mode" 2) MARK_AS_ADVANCED(LUAJIT_DISABLE_FFI LUAJIT_ENABLE_LUA52COMPAT LUAJIT_DISABLE_GC64 diff --git a/src/lj_load.c b/src/lj_load.c index 29e45a54..a158b41f 100644 --- a/src/lj_load.c +++ b/src/lj_load.c @@ -231,19 +231,21 @@ LUALIB_API int luaL_loadbuffer(lua_State *L, const char *buf, size_t size, { #if LJ_DS_LOADBUFFER_PATCH if (buf != name){ - if (lj_path_map){ - const char* real_path = lj_path_map(name); - if (real_path){ + if (name[0] != '@'){ + if (lj_path_map){ + const char* real_path = lj_path_map(name); + if (real_path){ + char path[260]; + snprintf(path, 260, "@%s", real_path); + return luaL_loadbufferx(L, buf, size, path, NULL); + } + } + if (strncmp(name, "scripts/", sizeof("scripts/") -1) == 0) { char path[260]; - snprintf(path, 260, "@%s", real_path); + snprintf(path, 260, "@%s", name); return luaL_loadbufferx(L, buf, size, path, NULL); } } - if (strncmp(name, "scripts/", sizeof("scripts/") -1) == 0) { - char path[260]; - snprintf(path, 260, "@%s", name); - return luaL_loadbufferx(L, buf, size, path, NULL); - } } #endif return luaL_loadbufferx(L, buf, size, name, NULL); diff --git a/src/lj_parse.c b/src/lj_parse.c index 44851f71..67d33ca8 100644 --- a/src/lj_parse.c +++ b/src/lj_parse.c @@ -1133,7 +1133,7 @@ static MSize var_lookup_(FuncState *fs, GCstr *name, ExpDesc *e, int first) if ((int32_t)reg >= 0) { /* Local in this function? */ expr_init(e, VLOCAL, reg); #if LUA_COMPAT_VARARG - if (!fs->need_vararg && fs->flags & PROTO_VARARG && reg == 0){ + if (!fs->need_vararg && fs->flags & PROTO_VARARG){ if (name->len == (sizeof("arg") - 1) && strncmp(strdata(name), "arg", name->len) == 0){ fs->need_vararg = 1; }