Skip to content

Commit 69b38b6

Browse files
committed
[silgen] When emitting a vtable thunk, verify the thunk after emission rather than when we tear down the SILGenModule.
This makes it easier to find bugs in the vtable thunk emission code since we just error right where we emit the thunk.
1 parent 7a6c880 commit 69b38b6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SILGen/SILGenPoly.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3404,6 +3404,10 @@ SILGenFunction::emitVTableThunk(SILDeclRef derived,
34043404

34053405
scope.pop();
34063406
B.createReturn(loc, result);
3407+
3408+
// Now that the thunk body has been completely emitted, verify the
3409+
// body early.
3410+
F.verify();
34073411
}
34083412

34093413
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)