Revert "Let's not crash the client and server on dbg_assert"

This reverts commit a6e144ea72.
This commit is contained in:
heinrich5991 2021-02-23 20:50:48 +01:00
parent 38eba0c83c
commit deb4917563
3 changed files with 7 additions and 15 deletions

View file

@ -114,7 +114,7 @@ void dbg_assert_imp(const char *filename, int line, int test, const char *msg)
if(!test)
{
dbg_msg("assert", "%s(%d): %s", filename, line, msg);
dbg_break_imp();
dbg_break();
}
}

View file

@ -42,16 +42,12 @@ extern "C" {
msg - Message that should be printed if the test fails.
Remarks:
Does nothing in release version
Does nothing in release version of the library.
See Also:
<dbg_break>
*/
#ifdef CONF_DEBUG
#define dbg_assert(test, msg) dbg_assert_imp(__FILE__, __LINE__, test, msg)
#else
#define dbg_assert(test, msg)
#endif
void dbg_assert_imp(const char *filename, int line, int test, const char *msg);
#ifdef __clang_analyzer__
@ -71,17 +67,12 @@ void dbg_assert_imp(const char *filename, int line, int test, const char *msg);
Breaks into the debugger.
Remarks:
Does nothing in release version
Does nothing in release version of the library.
See Also:
<dbg_assert>
*/
#ifdef CONF_DEBUG
#define dbg_break() dbg_break_imp()
#else
#define dbg_break()
#endif
void dbg_break_imp();
void dbg_break();
/*
Function: dbg_msg
@ -93,7 +84,7 @@ void dbg_break_imp();
fmt - A printf styled format string.
Remarks:
Also works in release version
Does nothing in release version of the library.
See Also:
<dbg_assert>

View file

@ -101,7 +101,8 @@ static int GetID(int Index)
void CUuidManager::RegisterName(int ID, const char *pName)
{
dbg_assert(GetIndex(ID) == m_aNames.size(), "names must be registered with increasing ID");
int Index = GetIndex(ID);
dbg_assert(Index == m_aNames.size(), "names must be registered with increasing ID");
CName Name;
Name.m_pName = pName;
Name.m_Uuid = CalculateUuid(pName);