bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69953: [PATCH] Remove duplicated asserts and checks


From: Sergey Vinokurov
Subject: bug#69953: [PATCH] Remove duplicated asserts and checks
Date: Sat, 23 Mar 2024 03:27:34 +0000
User-agent: Mozilla Thunderbird

Hello,

I noticed that emacs-module.c contains duplicate module_non_local_exit_check() checks and module_assert_thread/module_assert_env asserts, mostly performed at the same point in program sequentially.

The module_non_local_exit_check() checks happen in MODULE_HANDLE_NONLOCAL_EXIT and MODULE_FUNCTION_BEGIN_NO_CATCH macros. The MODULE_HANDLE_NONLOCAL_EXIT is never used by itself, only as part of MODULE_FUNCTION_BEGIN which starts with MODULE_FUNCTION_BEGIN_NO_CATCH that performs the check.

In addition, there're 6 "Implementation of runtime and environment functions" rules outlined where MODULE_HANDLE_NONLOCAL_EXIT should be called at step 4 but module_non_local_exit_check() is supposed to have already happened at step 3 so documentation does not seem to intend for the check to be repeated in MODULE_HANDLE_NONLOCAL_EXIT.

Regarding asserts my observation is that module_non_local_exit_check() already contains module_assert_thread and module_assert_env so there's no need to do asserts if first thing we do is call module_non_local_exit_check.

Regards,
Sergey

Attachment: 0001-Remove-duplicated-asserts-and-checks.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]