Skip to content

Commit

Permalink
Fix crash in selector-append('.x~~', 'a')
Browse files Browse the repository at this point in the history
Fixes sass#2663
  • Loading branch information
glebm authored and xzyfer committed Nov 26, 2018
1 parent 2a4935c commit 280ffd8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/fn_selectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,13 @@ namespace Sass {

// TODO: Add check for namespace stuff

// append any selectors in childSeq's head
parentSeqClone->mutable_last()->head()->concat(base->head());

// Set parentSeqClone new tail
parentSeqClone->mutable_last()->tail( base->tail() );
Complex_Selector_Ptr lastComponent = parentSeqClone->mutable_last();
if (lastComponent->head() == nullptr) {
std::string msg = "Parent \"" + parentSeqClone->to_string() + "\" is incompatible with \"" + base->to_string() + "\"";
error(msg, pstate, traces);
}
lastComponent->head()->concat(base->head());
lastComponent->tail(base->tail());

newElements.push_back(parentSeqClone);
}
Expand Down

0 comments on commit 280ffd8

Please sign in to comment.