revert a nonnull instance that deviated from the stated rules

This commit is contained in:
nhmall
2023-12-15 00:52:15 -05:00
parent 6467b983eb
commit b368d4fbe9
2 changed files with 3 additions and 5 deletions

View File

@@ -1979,7 +1979,7 @@ extern void l_nhcore_done(void);
extern void l_nhcore_call(int);
extern lua_State * nhl_init(nhl_sandbox_info *) NONNULLARG1;
/* nhl_done contains a test for NULL arg1, preventing NONNULLARG1 */
extern void nhl_done(lua_State *) NONNULLARG1;
extern void nhl_done(lua_State *) NO_NONNULLS;
extern boolean nhl_loadlua(lua_State *, const char *) NONNULLARG12;
extern char *get_nh_lua_variables(void);
extern void save_luadata(NHFILE *) NONNULLARG1;

View File

@@ -2092,10 +2092,8 @@ RESTORE_WARNING_CONDEXPR_IS_CONSTANT
void
nhl_done(lua_State *L)
{
lua_State *L2 = L; /* allow arg to be declared nonnull */
if (L2)
lua_close(L2);
if (L)
lua_close(L);
iflags.in_lua = FALSE;
}