Reduce assert to a warning (#1115)

This commit is contained in:
Paris Oplopoios 2024-09-28 15:44:07 +03:00 committed by GitHub
parent 7476287649
commit 65bd62e98b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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);