| 94 | |
| 95 | |
| 96 | static int docall (lua_State *L, int narg, int clear) { |
| 97 | int status; |
| 98 | int base = lua_gettop(L) - narg; /* function index */ |
| 99 | lua_pushcfunction(L, traceback); /* push traceback function */ |
| 100 | lua_insert(L, base); /* put it under chunk and args */ |
| 101 | signal(SIGINT, laction); |
| 102 | status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); |
| 103 | signal(SIGINT, SIG_DFL); |
| 104 | lua_remove(L, base); /* remove traceback function */ |
| 105 | /* force a complete garbage collection in case of errors */ |
| 106 | if (status != 0) lua_gc(L, LUA_GCCOLLECT, 0); |
| 107 | return status; |
| 108 | } |
| 109 | |
| 110 | |
| 111 | static void print_version (void) { |
no test coverage detected