@@ -626,7 +626,7 @@ namespace Sass {
626626
627627 for (sass::vector<SelectorComponentObj>& components : weaved) {
628628
629- ComplexSelectorObj cplx = SASS_MEMORY_NEW (ComplexSelector, " [phony] " );
629+ ComplexSelectorObj cplx = SASS_MEMORY_NEW (ComplexSelector, complex -> pstate () );
630630 cplx->hasPreLineFeed (complex ->hasPreLineFeed ());
631631 for (auto & pp : path) {
632632 if (pp->hasPreLineFeed ()) {
@@ -643,7 +643,18 @@ namespace Sass {
643643 }
644644 first = false ;
645645
646- result.push_back (cplx);
646+ auto it = result.begin ();
647+ while (it != result.end ()) {
648+ if (ObjEqualityFn (*it, cplx)) break ;
649+ it += 1 ;
650+ }
651+ if (it == result.end ()) {
652+ result.push_back (cplx);
653+ }
654+
655+ if (result.size () > 500 ) {
656+ throw Exception::EndlessExtendError (traces, complex );
657+ }
647658
648659 }
649660
@@ -838,7 +849,7 @@ namespace Sass {
838849 }
839850 if (!originals.empty ()) {
840851 CompoundSelectorObj merged =
841- SASS_MEMORY_NEW (CompoundSelector, " [phony ]" );
852+ SASS_MEMORY_NEW (CompoundSelector, " [compound ]" );
842853 merged->concat (originals);
843854 toUnify.insert (toUnify.begin (), { merged });
844855 }
@@ -1050,7 +1061,7 @@ namespace Sass {
10501061 }
10511062 }
10521063
1053- SelectorListObj list = SASS_MEMORY_NEW (SelectorList, " [phony ]" );
1064+ SelectorListObj list = SASS_MEMORY_NEW (SelectorList, " [pseudo ]" );
10541065 list->concat (expanded);
10551066 return { pseudo->withSelector (list) };
10561067
0 commit comments