Skip to content

Commit

Permalink
Fix reading off the end of the instructionToBlock array
Browse files Browse the repository at this point in the history
  • Loading branch information
Zorro666 committed Dec 18, 2024
1 parent aee9013 commit e96d1b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion renderdoc/driver/shaders/dxil/dxil_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit e96d1b6

Please sign in to comment.