panic while reading from stdin (#1529)

Co-authored-by: jietao.cjt <jietao.cjt@alibaba-inc.com>
This commit is contained in:
t0350
2022-02-08 20:27:29 +08:00
committed by GitHub
parent 6d6be8dec6
commit 3c4f673740

View File

@@ -1221,7 +1221,7 @@ static int cache_mode(lua_State *L) {
LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename,
const char *mode) {
int level = cache_level(L);
if (level == CACHE_OFF) {
if (level == CACHE_OFF || filename == NULL) {
return luaL_loadfilex_(L, filename, mode);
}
const void * proto = load_proto(filename);