Reduce assert to a warning

This commit is contained in:
offtkp 2024-09-27 21:32:31 +03:00
parent 75166ecd2a
commit c0b90ff76a

View file

@ -1053,7 +1053,14 @@ static bool TryExecuteIllegalInstruction(void* ctx, void* code_address) {
}
u64 index = (lowQWordSrc >> 8) & 0x3F;
ASSERT_MSG(length + index <= 64, "length + index must be less than or equal to 64.");
if (length + index > 64) {
// Undefined behavior if length + index is bigger than 64 according to the spec,
// we'll warn and continue execution.
LOG_WARNING(Core,
"extrq at {:x} with length {} and index {} is bigger than 64, "
"undefined behavior",
fmt::ptr(code_address), length, index);
}
lowQWordDst >>= index;
lowQWordDst &= mask;
@ -1106,7 +1113,14 @@ static bool TryExecuteIllegalInstruction(void* ctx, void* code_address) {
}
u64 index = (highQWordSrc >> 8) & 0x3F;
ASSERT_MSG(length + index <= 64, "length + index must be less than or equal to 64.");
if (length + index > 64) {
// Undefined behavior if length + index is bigger than 64 according to the spec,
// we'll warn and continue execution.
LOG_WARNING(Core,
"insertq at {:x} with length {} and index {} is bigger than 64, "
"undefined behavior",
fmt::ptr(code_address), length, index);
}
lowQWordSrc &= mask;
lowQWordDst &= ~(mask << index);