Skip to content

Commit 783118e

Browse files
authored
Merge pull request #80310 from gottesmm/pr-595edb2e0a8eecd7a5133d8932ed1c67b8e7c76c
[silgen] If SILVerifyAll is enabled verify the body of thunks in buildThunkBody
2 parents de7a62e + 67730c1 commit 783118e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SILGen/SILGenPoly.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
#include "Scope.h"
9696
#include "TupleGenerators.h"
9797
#include "swift/Basic/Assertions.h"
98+
#include "swift/Basic/Defer.h"
9899
#include "swift/Basic/Generators.h"
99100
#include "swift/AST/ASTMangler.h"
100101
#include "swift/AST/ConformanceLookup.h"
@@ -5400,6 +5401,11 @@ static void buildThunkBody(SILGenFunction &SGF, SILLocation loc,
54005401
PrettyStackTraceSILFunction stackTrace("emitting reabstraction thunk in",
54015402
&SGF.F);
54025403
auto thunkType = SGF.F.getLoweredFunctionType();
5404+
SWIFT_DEFER {
5405+
// If verify all is enabled, verify thunk bodies.
5406+
if (SGF.getASTContext().SILOpts.VerifyAll)
5407+
SGF.F.verify();
5408+
};
54035409

54045410
FullExpr scope(SGF.Cleanups, CleanupLocation(loc));
54055411

0 commit comments

Comments
 (0)