Skip to content

Commit 5a6b589

Browse files
committed
SILFunctionBuilder: Don't create [serialized] function post serialization
This might fix the randomly occuring errors of: ``` SIL verification failed: cannot have a serialized function after the module has been serialized: !F->isSerialized() || !mod.isSerialized() || mod.isParsedAsSerializedSIL() ```
1 parent c1554f6 commit 5a6b589

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SIL/IR/SILFunctionBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,11 @@ SILFunction *SILFunctionBuilder::getOrCreateFunction(
270270

271271
IsTransparent_t IsTrans =
272272
constant.isTransparent() ? IsTransparent : IsNotTransparent;
273+
273274
IsSerialized_t IsSer = constant.isSerialized();
275+
// Don't create a [serialized] function after serialization has happened.
276+
if (IsSer == IsSerialized && mod.isSerialized())
277+
IsSer = IsNotSerialized;
274278

275279
Inline_t inlineStrategy = InlineDefault;
276280
if (constant.isNoinline())

0 commit comments

Comments
 (0)