From b368d4fbe9099c4941f274f18e9b5cdec9e8cce5 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 15 Dec 2023 00:52:15 -0500 Subject: [PATCH] revert a nonnull instance that deviated from the stated rules --- include/extern.h | 2 +- src/nhlua.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/extern.h b/include/extern.h index c3848a746..cc569b9b1 100644 --- a/include/extern.h +++ b/include/extern.h @@ -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; diff --git a/src/nhlua.c b/src/nhlua.c index 6d8a5eba6..8eb14f591 100644 --- a/src/nhlua.c +++ b/src/nhlua.c @@ -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; }