diff --git a/qrenderdoc/Windows/ShaderViewer.cpp b/qrenderdoc/Windows/ShaderViewer.cpp index bd7e0685f..2d88c79eb 100644 --- a/qrenderdoc/Windows/ShaderViewer.cpp +++ b/qrenderdoc/Windows/ShaderViewer.cpp @@ -2170,8 +2170,8 @@ bool ShaderViewer::step(bool forward, StepMode mode) // keep going until we hit the closest instruction of any block that maps to this function while(!IsFirstState() && !targetInsts.contains(GetCurrentState().nextInstruction)) { - if((oldStack == GetPreviousState().callstack || - oldStack.size() > GetPreviousState().callstack.size()) && + const rdcarray &prevStack = GetPreviousState().callstack; + if((oldStack == prevStack || (!prevStack.empty() && oldStack.size() > prevStack.size())) && !oldLine.SourceEqual(GetPreviousInstInfo().lineInfo)) { // if we hit this case, it means we jumped to an instruction in the same call which maps