MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaD_closeprotected

Function luaD_closeprotected

third-party/lua-5.5.0/src/ldo.c:1059–1073  ·  view source on GitHub ↗

** Calls 'luaF_close' in protected mode. Return the original status ** or, in case of errors, the new status. */

Source from the content-addressed store, hash-verified

1057** or, in case of errors, the new status.
1058*/
1059TStatus luaD_closeprotected (lua_State *L, ptrdiff_t level, TStatus status) {
1060 CallInfo *old_ci = L->ci;
1061 lu_byte old_allowhooks = L->allowhook;
1062 for (;;) { /* keep closing upvalues until no more errors */
1063 struct CloseP pcl;
1064 pcl.level = restorestack(L, level); pcl.status = status;
1065 status = luaD_rawrunprotected(L, &closepaux, &pcl);
1066 if (l_likely(status == LUA_OK)) /* no more errors? */
1067 return pcl.status;
1068 else { /* an error occurred; restore saved state and repeat */
1069 L->ci = old_ci;
1070 L->allowhook = old_allowhooks;
1071 }
1072 }
1073}
1074
1075
1076/*

Callers 3

close_stateFunction · 0.70
luaE_resetthreadFunction · 0.70
luaD_pcallFunction · 0.70

Calls 1

luaD_rawrunprotectedFunction · 0.70

Tested by

no test coverage detected