Skip to content

Commit 784034f

Browse files
committed
[DebugInfo] Fix scope mapping in ClosureCloner
1 parent bc3bf84 commit 784034f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/SILOptimizer/Mandatory/CapturePromotion.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,10 @@ void ClosureCloner::visitDebugValueInst(DebugValueInst *inst) {
585585
if (inst->hasAddrVal())
586586
if (SILValue value = getProjectBoxMappedVal(inst->getOperand())) {
587587
getBuilder().setCurrentDebugScope(getOpScope(inst->getDebugScope()));
588-
getBuilder().createDebugValue(inst->getLoc(), value, *inst->getVarInfo());
588+
auto varInfo = *inst->getVarInfo();
589+
if (varInfo.Scope)
590+
varInfo.Scope = getOpScope(inst->getDebugScope());
591+
getBuilder().createDebugValue(inst->getLoc(), value, varInfo);
589592
return;
590593
}
591594
SILCloner<ClosureCloner>::visitDebugValueInst(inst);

0 commit comments

Comments
 (0)