MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaB_auxwrap

Function luaB_auxwrap

lib/lua/src/lcorolib.c:73–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72
73static int luaB_auxwrap (lua_State *L) {
74 lua_State *co = lua_tothread(L, lua_upvalueindex(1));
75 int r = auxresume(L, co, lua_gettop(L));
76 if (l_unlikely(r < 0)) { /* error? */
77 int stat = lua_status(co);
78 if (stat != LUA_OK && stat != LUA_YIELD) { /* error in the coroutine? */
79 stat = lua_closethread(co, L); /* close its tbc variables */
80 lua_assert(stat != LUA_OK);
81 lua_xmove(co, L, 1); /* move error message to the caller */
82 }
83 if (stat != LUA_ERRMEM && /* not a memory error and ... */
84 lua_type(L, -1) == LUA_TSTRING) { /* ... error object is a string? */
85 luaL_where(L, 1); /* add extra info, if available */
86 lua_insert(L, -2);
87 lua_concat(L, 2);
88 }
89 return lua_error(L); /* propagate error */
90 }
91 return r;
92}
93
94
95static int luaB_cocreate (lua_State *L) {

Callers

nothing calls this directly

Calls 10

lua_tothreadFunction · 0.85
auxresumeFunction · 0.85
lua_gettopFunction · 0.85
lua_statusFunction · 0.85
lua_closethreadFunction · 0.85
lua_xmoveFunction · 0.85
lua_typeFunction · 0.85
luaL_whereFunction · 0.85
lua_concatFunction · 0.85
lua_errorFunction · 0.85

Tested by

no test coverage detected