summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-ssa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/slang-ir-ssa.cpp')
-rw-r--r--source/slang/slang-ir-ssa.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slang/slang-ir-ssa.cpp b/source/slang/slang-ir-ssa.cpp
index 8d561fa05..14198aa0a 100644
--- a/source/slang/slang-ir-ssa.cpp
+++ b/source/slang/slang-ir-ssa.cpp
@@ -1109,7 +1109,7 @@ void constructSSA(ConstructSSAContext* context)
}
}
- // Some blocks may now need to pass along arguments to their sucessor,
+ // Some blocks may now need to pass along arguments to their successor,
// which have been stored into the `SSABlockInfo::successorArgs` field.
for(auto bb : globalVal->getBlocks())
{
@@ -1156,6 +1156,9 @@ void constructSSA(ConstructSSAContext* context)
//
oldTerminator->transferDecorationsTo(newTerminator);
+ // Copy the source location of the old terminator to the new terminator
+ newTerminator->sourceLoc = oldTerminator->sourceLoc;
+
// A terminator better not have uses, so we shouldn't have
// to replace them.
SLANG_ASSERT(!oldTerminator->firstUse);