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

Function luaD_closeprotected

third-party/lua-5.4.6/src/ldo.c:935–949  ·  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

933** or, in case of errors, the new status.
934*/
935int luaD_closeprotected (lua_State *L, ptrdiff_t level, int status) {
936 CallInfo *old_ci = L->ci;
937 lu_byte old_allowhooks = L->allowhook;
938 for (;;) { /* keep closing upvalues until no more errors */
939 struct CloseP pcl;
940 pcl.level = restorestack(L, level); pcl.status = status;
941 status = luaD_rawrunprotected(L, &closepaux, &pcl);
942 if (l_likely(status == LUA_OK)) /* no more errors? */
943 return pcl.status;
944 else { /* an error occurred; restore saved state and repeat */
945 L->ci = old_ci;
946 L->allowhook = old_allowhooks;
947 }
948 }
949}
950
951
952/*

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