Log a backtrace before throwing serialization_failed

This commit is contained in:
Andrew Noyes 2022-05-12 11:05:28 -07:00 committed by Jingyu Zhou
parent 370a9e1d92
commit a92ef37d44
2 changed files with 3 additions and 0 deletions

View File

@ -479,6 +479,7 @@ struct ConnectPacket {
serializer(ar, connectPacketLength);
if (connectPacketLength > sizeof(ConnectPacket) - sizeof(connectPacketLength)) {
ASSERT(!g_network->isSimulated());
TraceEvent("SerializationFailed").backtrace();
throw serialization_failed();
}

View File

@ -25,6 +25,7 @@
_AssumeVersion::_AssumeVersion(ProtocolVersion version) : v(version) {
if (!version.isValid()) {
ASSERT(!g_network->isSimulated());
TraceEvent("SerializationFailed").backtrace();
throw serialization_failed();
}
}
@ -34,6 +35,7 @@ const void* BinaryReader::readBytes(int bytes) {
const char* e = b + bytes;
if (e > end) {
ASSERT(!g_network->isSimulated());
TraceEvent("SerializationFailed").backtrace();
throw serialization_failed();
}
begin = e;