Skip to content

Commit 90b23a6

Browse files
committed
[sil] Replace a thinko in getNextInstruction().
We were using std::next on the pointer, not the iterator meaning we were accessing bad memory.
1 parent f39df1d commit 90b23a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SIL/IR/SILValue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ SILInstruction *ValueBase::getDefiningInsertionPoint() {
8383

8484
SILInstruction *ValueBase::getNextInstruction() {
8585
if (auto *inst = getDefiningInstruction())
86-
return std::next(inst);
86+
return &*std::next(inst->getIterator());
8787
if (auto *arg = dyn_cast<SILArgument>(this))
8888
return &*arg->getParentBlock()->begin();
8989
return nullptr;

0 commit comments

Comments
 (0)