This repository was archived by the owner on Oct 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Expand file tree Collapse file tree 3 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -142,6 +142,7 @@ namespace Sass {
142142 // ##########################################################################
143143 bool Extender::checkForUnsatisfiedExtends (Extension& unsatisfied) const
144144 {
145+ if (selectors.empty ()) return false ;
145146 ExtSmplSelSet originals = getSimpleSelectors ();
146147 for (auto target : extensions) {
147148 SimpleSelector* key = target.first ;
Original file line number Diff line number Diff line change @@ -2247,15 +2247,17 @@ namespace Sass {
22472247 if (lex < kwd_not >()) { media_query->is_negated (true ); lex < css_comments >(false ); }
22482248 else if (lex < kwd_only >()) { media_query->is_restricted (true ); lex < css_comments >(false ); }
22492249
2250- if (lex < identifier_schema >()) media_query->media_type (parse_identifier_schema ());
2251- else if (lex < identifier >()) media_query->media_type (parse_interpolated_chunk (lexed));
2250+ if (lex < identifier_schema >()) media_query->media_type (parse_identifier_schema ());
2251+ else if (lex < identifier >()) media_query->media_type (parse_interpolated_chunk (lexed));
22522252 else media_query->append (parse_media_expression ());
22532253
22542254 while (lex_css < kwd_and >()) media_query->append (parse_media_expression ());
22552255 if (lex < identifier_schema >()) {
22562256 String_Schema* schema = SASS_MEMORY_NEW (String_Schema, pstate);
2257- schema->append (media_query->media_type ());
2258- schema->append (SASS_MEMORY_NEW (String_Constant, pstate, " " ));
2257+ if (media_query->media_type ()) {
2258+ schema->append (media_query->media_type ());
2259+ schema->append (SASS_MEMORY_NEW (String_Constant, pstate, " " ));
2260+ }
22592261 schema->append (parse_identifier_schema ());
22602262 media_query->media_type (schema);
22612263 }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ namespace Sass {
2424
2525 size_t L = in.size (), n = 0 ;
2626
27+ if (L == 0 ) return {};
2728 // Exit early if any entry is empty
2829 for (size_t i = 0 ; i < L; i += 1 ) {
2930 if (in[i].size () == 0 ) return {};
@@ -80,12 +81,18 @@ namespace Sass {
8081
8182 size_t L = in.size ();
8283 size_t n = in.size () - 1 ;
84+
85+ if (L == 0 ) return {};
86+ // Exit early if any entry is empty
87+ for (size_t i = 0 ; i < L; i += 1 ) {
88+ if (in[i].size () == 0 ) return {};
89+ }
90+
8391 size_t * state = new size_t [L];
8492 std::vector< std::vector<T>> out;
8593
8694 // First initialize all states for every permutation group
8795 for (size_t i = 0 ; i < L; i += 1 ) {
88- if (in[i].size () == 0 ) return {};
8996 state[i] = in[i].size () - 1 ;
9097 }
9198
@@ -104,10 +111,8 @@ namespace Sass {
104111 // Current group finished
105112 if (state[n] == 0 ) {
106113 // Find position of next decrement
107- while (n > 0 && state[--n] == 0 )
108- {
114+ while (n > 0 && state[--n] == 0 ) {}
109115
110- }
111116 // Check for end condition
112117 if (state[n] != 0 ) {
113118 // Decrease next on the left side
You can’t perform that action at this time.
0 commit comments