Skip to content

Commit f07c72b

Browse files
authored
Merge pull request #61311 from eeckstein/fix-cmo
CrossModuleOptimization: fix a bug in cycle-detection
2 parents 5cf1cb3 + f0b0d3f commit f07c72b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/SILOptimizer/IPO/CrossModuleOptimization.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ bool CrossModuleOptimization::canSerializeFunction(
185185
if (iter != canSerializeFlags.end())
186186
return iter->second;
187187

188+
// Temporarily set the flag to false (to avoid infinite recursion) until we set
189+
// it to true at the end of this function.
190+
canSerializeFlags[function] = false;
191+
188192
if (DeclContext *funcCtxt = function->getDeclContext()) {
189193
if (!canUseFromInline(funcCtxt))
190194
return false;

0 commit comments

Comments
 (0)