Skip to content

Commit 6711c90

Browse files
committed
SILBuilder: add an assertion in getInsertionPointLoc()
1 parent 8816034 commit 6711c90

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/swift/SIL/SILBuilder.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,10 @@ class SILBuilder {
263263
bool hasValidInsertionPoint() const { return BB != nullptr; }
264264
SILBasicBlock *getInsertionBB() const { return BB; }
265265
SILBasicBlock::iterator getInsertionPoint() const { return InsertPt; }
266-
SILLocation getInsertionPointLoc() const { return InsertPt->getLoc(); }
266+
SILLocation getInsertionPointLoc() const {
267+
assert(!insertingAtEndOfBlock());
268+
return InsertPt->getLoc();
269+
}
267270

268271
/// insertingAtEndOfBlock - Return true if the insertion point is at the end
269272
/// of the current basic block. False if we're inserting before an existing

0 commit comments

Comments
 (0)