Fix copy of loop variable in SPIRV by using reference

This commit is contained in:
Jannik
2020-10-12 12:04:11 +02:00
committed by Baldur Karlsson
parent 89af50a76c
commit 7bcdf9b335
2 changed files with 4 additions and 4 deletions
@@ -330,7 +330,7 @@ void ThreadState::ProcessScopeChange(const rdcarray<Id> &oldLive, const rdcarray
const rdcarray<Id> &liveGlobals = debugger.GetLiveGlobals();
for(const Id id : oldLive)
for(const Id &id : oldLive)
{
if(liveGlobals.contains(id))
continue;
@@ -338,7 +338,7 @@ void ThreadState::ProcessScopeChange(const rdcarray<Id> &oldLive, const rdcarray
m_State->changes.push_back({debugger.GetPointerValue(ids[id])});
}
for(const Id id : newLive)
for(const Id &id : newLive)
{
if(liveGlobals.contains(id))
continue;
@@ -2376,9 +2376,9 @@ void Debugger::RegisterOp(Iter it)
{
// don't automatically kill function parameters and variables. They will be manually killed when
// returning from a function's scope
for(const Id id : curFunction->parameters)
for(const Id &id : curFunction->parameters)
idDeathOffset[id] = ~0U;
for(const Id id : curFunction->variables)
for(const Id &id : curFunction->variables)
idDeathOffset[id] = ~0U;
curFunction = NULL;