File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -370,6 +370,8 @@ static bool createsInfiniteSpecializationLoop(ApplySite Apply) {
370370 LLVM_DEBUG (llvm::dbgs () << " Scan caller's specialization history\n " );
371371 }
372372
373+ llvm::SmallSet<const GenericSpecializationInformation *, 8 > visited;
374+
373375 while (CurSpecializationInfo) {
374376 LLVM_DEBUG (llvm::dbgs () << " Current caller is a specialization:\n "
375377 << " Caller: "
@@ -385,6 +387,10 @@ static bool createsInfiniteSpecializationLoop(ApplySite Apply) {
385387 Replacement->dump (llvm::dbgs ());
386388 });
387389
390+ if (!visited.insert (CurSpecializationInfo).second ) {
391+ return true ;
392+ }
393+
388394 if (CurSpecializationInfo->getParent () == GenericFunc) {
389395 LLVM_DEBUG (llvm::dbgs () << " Found a call graph loop, checking "
390396 " substitutions\n " );
You can’t perform that action at this time.
0 commit comments