Fix reading off the end of the instructionToBlock array

This commit is contained in:
Jake Turner
2024-12-18 15:39:29 +00:00
parent aee9013a8f
commit e96d1b6c1a
+2 -1
View File
@@ -7614,7 +7614,8 @@ ShaderDebugTrace *Debugger::BeginDebug(uint32_t eventId, const DXBC::DXBCContain
if(it != info.maxExecPointPerId.end())
{
const ExecutionPoint &current = it->second;
const uint32_t scopeEndInst = scope->maxInstruction + 1;
uint32_t scopeEndInst = scope->maxInstruction + 1;
scopeEndInst = RDCMIN(scopeEndInst, (uint32_t)info.instructionToBlock.size() - 1);
const uint32_t scopeEndBlock = info.instructionToBlock[scopeEndInst];
ExecutionPoint scopeEnd(scopeEndBlock, scopeEndInst);
if(scopeEnd.IsAfter(current, info.controlFlow))