Don't crash if stepping back from last instruction

This commit is contained in:
baldurk
2018-06-22 19:28:32 +01:00
parent 8381a1955e
commit 06b7e39c26
+2 -1
View File
@@ -1089,7 +1089,8 @@ bool ShaderViewer::stepBack()
{
const ShaderDebugState &oldstate = m_Trace->states[CurrentStep()];
LineColumnInfo oldLine = m_Trace->lineInfo[oldstate.nextInstruction];
LineColumnInfo oldLine =
m_Trace->lineInfo[qMax(m_Trace->lineInfo.size() - 1, (size_t)oldstate.nextInstruction)];
while(CurrentStep() < m_Trace->states.count())
{