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

Function luaD_closeprotected

lib/lua/src/ldo.c:928–942  ·  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

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

Callers 3

close_stateFunction · 0.85
luaE_resetthreadFunction · 0.85
luaD_pcallFunction · 0.85

Calls 1

luaD_rawrunprotectedFunction · 0.85

Tested by

no test coverage detected