Skip to content

Commit

Permalink
Protect against weirdness in UnlinkBlocks (hopefully not needed after…
Browse files Browse the repository at this point in the history
… prev fix)
  • Loading branch information
hrydgard committed Sep 27, 2023
1 parent 1fff976 commit 4c0077f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Core/MIPS/JitCommon/JitBlockCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,11 @@ void JitBlockCache::UnlinkBlock(int i) {
if (ppp.first == ppp.second)
return;
for (auto iter = ppp.first; iter != ppp.second; ++iter) {
if ((size_t)iter->second >= num_blocks_) {
// Something probably went very wrong. Try to stumble along nevertheless.
ERROR_LOG(JIT, "UnlinkBlock: Invalid block number %d", iter->second);
continue;
}
JitBlock &sourceBlock = blocks_[iter->second];
for (int e = 0; e < MAX_JIT_BLOCK_EXITS; e++) {
if (sourceBlock.exitAddress[e] == b.originalAddress)
Expand Down
2 changes: 2 additions & 0 deletions GPU/Common/SoftwareTransformCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,8 @@ void SoftwareTransform::BuildDrawingParams(int prim, int vertexCount, u32 vertTy
result->drawBuffer = transformedExpanded;
result->drawIndexed = true;
} else if (prim == GE_PRIM_LINES) {
// TODO: What about GE_PRIM_LINE_STRIP?

if (!ExpandLines(vertexCount, maxIndex, inds, indsOffset, indexBufferSize, transformed, transformedExpanded, numTrans, throughmode)) {
result->drawIndexed = false;
result->drawNumTrans = 0;
Expand Down

0 comments on commit 4c0077f

Please sign in to comment.