Skip to content

Commit 873922b

Browse files
committed
[silgen] Verify protocol witnesses's SIL right after emitting them.
These still get verified as part of SILGenModule's verification during SILGenModule's destructor. But moving this earlier catches the error earlier and makes it easier to debug any SIL issues immediately in the debugger rather than having to backtrack from the SILGenModule's destructor.
1 parent 1526cfa commit 873922b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/SILGen/SILGenPoly.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4617,4 +4617,7 @@ void SILGenFunction::emitProtocolWitness(
46174617
formalEvalScope.pop();
46184618
scope.pop();
46194619
B.createReturn(loc, reqtResultValue);
4620+
4621+
// Now that we have finished emitting the function, verify it!
4622+
F.verify();
46204623
}

0 commit comments

Comments
 (0)