Merge pull request #19173 from hrydgard/ir-interpreter-prefix-check

IRInterpreter compiler: Reject all vec2ops where the prefix is unknown while compiling
This commit is contained in:
Henrik Rydgård 2024-05-23 00:19:44 +02:00 committed by GitHub
commit b6ce56dec0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -884,7 +884,7 @@ static int sysclib_sprintf(u32 dst, u32 fmt) {
DEBUG_LOG(SCEKERNEL, "sysclib_sprintf result string has length %d, content:", (int)result.length());
DEBUG_LOG(SCEKERNEL, "%s", result.c_str());
if (!Memory::IsValidRange(dst, result.length() + 1)) {
if (!Memory::IsValidRange(dst, (u32)result.length() + 1)) {
ERROR_LOG(SCEKERNEL, "sysclib_sprintf result string is too long or dst is invalid");
return 0;
}

View file

@ -969,6 +969,11 @@ namespace MIPSComp {
void IRFrontend::Comp_VV2Op(MIPSOpcode op) {
CONDITIONAL_DISABLE(VFPU_VEC);
if (js.HasUnknownPrefix()) {
DISABLE;
}
int optype = (op >> 16) & 0x1f;
if (optype == 0) {
if (js.HasUnknownPrefix() || !IsPrefixWithinSize(js.prefixS, op))