From 75175f3bc180d6b00cbf2e198299d92711b1425c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 20 Feb 2022 15:45:06 +0200 Subject: [PATCH 44/44] Fix luascript_func_check() on FREECIV_NDEBUG build It had necessary functionality inside fc_assert_ret_val() See osdn #43871 Signed-off-by: Marko Lindqvist --- common/scriptcore/luascript_func.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/scriptcore/luascript_func.c b/common/scriptcore/luascript_func.c index 2262a451ff..9c1fa753ed 100644 --- a/common/scriptcore/luascript_func.c +++ b/common/scriptcore/luascript_func.c @@ -104,8 +104,12 @@ bool luascript_func_check(struct fc_lua *fcl, if (!luascript_check_function(fcl, func_name)) { struct luascript_func *pfunc; - fc_assert_ret_val(luascript_func_hash_lookup(fcl->funcs, func_name, - &pfunc), FALSE); +#ifndef FREECIV_NDEBUG + bool success = +#endif + luascript_func_hash_lookup(fcl->funcs, func_name, &pfunc); + + fc_assert_ret_val(success, FALSE); if (pfunc->required) { strvec_append(missing_func_required, func_name); -- 2.34.1