aboutsummaryrefslogtreecommitdiff
path: root/src/lj_load.c
diff options
context:
space:
mode:
authorMike Pall <mike>2025-04-07 10:27:40 +0200
committerMike Pall <mike>2025-04-07 10:27:40 +0200
commite76bb50d44702f601ec5dd167b03b475ed53860c (patch)
tree74b3d09c7947e0bb654b0717c1352dbef5460a5a /src/lj_load.c
parente9e4b6d302b5e7e4a04a3c7f78cb561a2c156a37 (diff)
downloadluajit-e76bb50d44702f601ec5dd167b03b475ed53860c.tar.gz
luajit-e76bb50d44702f601ec5dd167b03b475ed53860c.tar.bz2
luajit-e76bb50d44702f601ec5dd167b03b475ed53860c.zip
Fix error generation in load*.
Reported by Sergey Kaplun. #1353
Diffstat (limited to '')
-rw-r--r--src/lj_load.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lj_load.c b/src/lj_load.c
index 90a61027..6c8ae9f1 100644
--- a/src/lj_load.c
+++ b/src/lj_load.c
@@ -108,8 +108,9 @@ LUALIB_API int luaL_loadfilex(lua_State *L, const char *filename,
108 copyTV(L, L->top-1, L->top); 108 copyTV(L, L->top-1, L->top);
109 } 109 }
110 if (err) { 110 if (err) {
111 const char *fname = filename ? filename : "stdin";
111 L->top--; 112 L->top--;
112 lua_pushfstring(L, "cannot read %s: %s", chunkname+1, strerror(err)); 113 lua_pushfstring(L, "cannot read %s: %s", fname, strerror(err));
113 return LUA_ERRFILE; 114 return LUA_ERRFILE;
114 } 115 }
115 return status; 116 return status;