What changed, and why it matters
This commit removes a Windows-only debug assertion helper called LOCAL_ASSERT that was effectively dead code. It does not change how the software handles errors in normal builds, and it does not introduce a security vulnerability.
No security action required. Treat as routine code hygiene.
Security signals we found
No security signal: change is cleanup of dead debug-only code
No change to input validation, parsing, cryptography, networking, or consensus logic
No change to error-handling semantics on non-Windows platforms
Evidence from the diff
The patch deletes LOCAL_ASSERT and the epee::debug::get_set_enable_assert toggle. LOCAL_ASSERT only did anything on Windows when compiled with MSVC, and even then it was only called inside CHECK_AND_ASSERT macros after a condition already failed. On non-Windows platforms the macro expanded to nothing. The commit replaces the macro body with a plain return of the failure value, which is the same runtime behavior that already occurred on Linux/macOS. Test code that tried to disable asserts is also removed because the function it called no longer exists. There is no functional change to release builds and no security boundary change.
Changed components
contrib/epee/include/misc_log_ex.htests/functional_tests/transactions_flow_test.cpptests/net_load_tests/clt.cpptests/unit_tests/main.cppInspect captured patch +2 / −28
diff --git a/contrib/epee/include/misc_log_ex.h b/contrib/epee/include/misc_log_ex.h
index fdd7d8c..fddf746 100644
--- a/contrib/epee/include/misc_log_ex.h
+++ b/contrib/epee/include/misc_log_ex.h
@@ -124,16 +124,6 @@
#define MLOG_SET_THREAD_NAME(x) el::Helpers::setThreadName(x)
-#ifndef LOCAL_ASSERT
-#include <assert.h>
-#if (defined _MSC_VER)
-#define LOCAL_ASSERT(expr) {if(epee::debug::get_set_enable_assert()){_ASSERTE(expr);}}
-#else
-#define LOCAL_ASSERT(expr)
-#endif
-
-#endif
-
std::string mlog_get_default_log_path(const char *default_filename);
void mlog_configure(const std::string &filename_base, bool console, const std::size_t max_log_file_size = MAX_LOG_FILE_SIZE, const std::size_t max_log_files = MAX_LOG_FILES);
void mlog_set_categories(const char *categories);
@@ -143,18 +133,6 @@ void mlog_set_log(const char *log);
namespace epee
{
-namespace debug
-{
- inline bool get_set_enable_assert(bool set = false, bool v = false)
- {
- static bool e = true;
- if(set)
- e = v;
- return e;
- }
-}
-
-
#define ENDL std::endl
@@ -195,7 +173,7 @@ namespace debug
#ifndef CHECK_AND_ASSERT
-#define CHECK_AND_ASSERT(expr, fail_ret_val) do{if(!(expr)){LOCAL_ASSERT(expr); return fail_ret_val;};}while(0)
+#define CHECK_AND_ASSERT(expr, fail_ret_val) do{if(!(expr)){return fail_ret_val;};}while(0)
#endif
#ifndef CHECK_AND_ASSERT_MES
@@ -203,7 +181,7 @@ namespace debug
#endif
#ifndef CHECK_AND_NO_ASSERT_MES_L
-#define CHECK_AND_NO_ASSERT_MES_L(expr, fail_ret_val, l, message) do{if(!(expr)) {LOG_PRINT_L##l(message); /*LOCAL_ASSERT(expr);*/ return fail_ret_val;};}while(0)
+#define CHECK_AND_NO_ASSERT_MES_L(expr, fail_ret_val, l, message) do{if(!(expr)) {LOG_PRINT_L##l(message); return fail_ret_val;};}while(0)
#endif
#ifndef CHECK_AND_NO_ASSERT_MES
diff --git a/tests/functional_tests/transactions_flow_test.cpp b/tests/functional_tests/transactions_flow_test.cpp
index 9823c13..b36cf1e 100644
--- a/tests/functional_tests/transactions_flow_test.cpp
+++ b/tests/functional_tests/transactions_flow_test.cpp
@@ -243,7 +243,6 @@ bool transactions_flow_test(std::string& working_folder,
if(!do_send_money(w1, w2, mix_in_factor, amount_to_tx, tx))
{
LOG_PRINT_L0( "failed to transfer money, second chance. tx: " << get_transaction_hash(tx) << ", exit" );
- LOCAL_ASSERT(false);
return false;
}
}
@@ -297,7 +296,6 @@ bool transactions_flow_test(std::string& working_folder,
MERROR("-----------------------FINISHING TRANSACTIONS FLOW TEST FAILED-----------------------" );
MERROR("income " << print_money(money_2) << " via " << i << " transactions, expected money = " << print_money(transfered_money) );
- LOCAL_ASSERT(false);
return false;
}
diff --git a/tests/net_load_tests/clt.cpp b/tests/net_load_tests/clt.cpp
index 5fd82a9..046ec83 100644
--- a/tests/net_load_tests/clt.cpp
+++ b/tests/net_load_tests/clt.cpp
@@ -631,7 +631,6 @@ int main(int argc, char** argv)
{
TRY_ENTRY();
tools::on_startup();
- epee::debug::get_set_enable_assert(true, false);
//set up logging options
mlog_configure(mlog_get_default_log_path("net_load_tests_clt.log"), true);
diff --git a/tests/unit_tests/main.cpp b/tests/unit_tests/main.cpp
index d613adb..31469c9 100644
--- a/tests/unit_tests/main.cpp
+++ b/tests/unit_tests/main.cpp
@@ -58,7 +58,6 @@ int main(int argc, char** argv)
tools::on_startup();
epee::string_tools::set_module_name_and_folder(argv[0]);
mlog_configure(mlog_get_default_log_path("unit_tests.log"), true);
- epee::debug::get_set_enable_assert(true, false);
::testing::InitGoogleTest(&argc, argv);
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.