Skip to content

Commit

Permalink
Merge pull request #19173 from hrydgard/ir-interpreter-prefix-check
Browse files Browse the repository at this point in the history
IRInterpreter compiler: Reject all vec2ops where the prefix is unknown while compiling
  • Loading branch information
hrydgard authored May 22, 2024
2 parents dc68f40 + 5e3abe3 commit b6ce56d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Core/HLE/sceKernelInterrupt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions Core/MIPS/IR/IRCompVFPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit b6ce56d

Please sign in to comment.