mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
better treatment for errors inside _ERRORMETHOD
This commit is contained in:
parent
79909a92e1
commit
46b543ebef
4 changed files with 12 additions and 9 deletions
6
lua.c
6
lua.c
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lua.c,v 1.51 2000/09/11 19:42:57 roberto Exp roberto $
|
||||
** $Id: lua.c,v 1.52 2000/09/25 16:15:52 roberto Exp roberto $
|
||||
** Lua stand-alone interpreter
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
|
@ -91,10 +91,12 @@ static int ldo (int (*f)(lua_State *l, const char *), const char *name) {
|
|||
res = f(L, name); /* dostring | dofile */
|
||||
lua_settop(L, top); /* remove eventual results */
|
||||
signal(SIGINT, h); /* restore old action */
|
||||
/* Lua gives no message in such cases, so lua.c provides one */
|
||||
if (res == LUA_ERRMEM) {
|
||||
/* Lua gives no message in such case, so lua.c provides one */
|
||||
fprintf(stderr, "lua: memory allocation error\n");
|
||||
}
|
||||
else if (res == LUA_ERRERR)
|
||||
fprintf(stderr, "lua: error in error message\n");
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue