1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

Everywhere: Rename ASSERT => VERIFY

(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
This commit is contained in:
Andreas Kling 2021-02-23 20:42:32 +01:00
parent b33a6a443e
commit 5d180d1f99
725 changed files with 3448 additions and 3448 deletions

View file

@ -45,8 +45,8 @@ void LineProgram::parse_unit_header()
{
m_stream >> Bytes { &m_unit_header, sizeof(m_unit_header) };
ASSERT(m_unit_header.version == DWARF_VERSION);
ASSERT(m_unit_header.opcode_base == SPECIAL_OPCODES_BASE);
VERIFY(m_unit_header.version == DWARF_VERSION);
VERIFY(m_unit_header.opcode_base == SPECIAL_OPCODES_BASE);
#if DWARF_DEBUG
dbgln("unit length: {}", m_unit_header.length);
@ -67,7 +67,7 @@ void LineProgram::parse_source_directories()
}
m_stream.handle_recoverable_error();
m_stream.discard_or_error(1);
ASSERT(!m_stream.has_any_error());
VERIFY(!m_stream.has_any_error());
}
void LineProgram::parse_source_files()
@ -87,7 +87,7 @@ void LineProgram::parse_source_files()
m_source_files.append({ file_name, directory_index });
}
m_stream.discard_or_error(1);
ASSERT(!m_stream.has_any_error());
VERIFY(!m_stream.has_any_error());
}
void LineProgram::append_to_line_info()
@ -131,7 +131,7 @@ void LineProgram::handle_extended_opcode()
break;
}
case ExtendedOpcodes::SetAddress: {
ASSERT(length == sizeof(size_t) + 1);
VERIFY(length == sizeof(size_t) + 1);
m_stream >> m_address;
#if DWARF_DEBUG
dbgln("SetAddress: {:p}", m_address);
@ -149,7 +149,7 @@ void LineProgram::handle_extended_opcode()
#if DWARF_DEBUG
dbgln("offset: {:p}", m_stream.offset());
#endif
ASSERT_NOT_REACHED();
VERIFY_NOT_REACHED();
}
}
void LineProgram::handle_standard_opcode(u8 opcode)
@ -191,7 +191,7 @@ void LineProgram::handle_standard_opcode(u8 opcode)
case StandardOpcodes::AdvanceLine: {
ssize_t line_delta;
m_stream.read_LEB128_signed(line_delta);
ASSERT(line_delta >= 0 || m_line >= (size_t)(-line_delta));
VERIFY(line_delta >= 0 || m_line >= (size_t)(-line_delta));
m_line += line_delta;
#if DWARF_DEBUG
dbgln("AdvanceLine: {}", m_line);
@ -223,7 +223,7 @@ void LineProgram::handle_standard_opcode(u8 opcode)
}
default:
dbgln("Unhandled LineProgram opcode {}", opcode);
ASSERT_NOT_REACHED();
VERIFY_NOT_REACHED();
}
}
void LineProgram::handle_sepcial_opcode(u8 opcode)