Skip to content

Commit

Permalink
Fix segfault when extending pseudo selectors failed (sass#2366)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed May 20, 2017
1 parent 77cdab7 commit 981dbeb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1947,8 +1947,10 @@ namespace Sass {
Wrapped_Selector_Obj cpy_ws = SASS_MEMORY_COPY(ws);
Selector_List_Obj cpy_ws_sl = SASS_MEMORY_NEW(Selector_List, sl->pstate());
// remove parent selectors from inner selector
if (ext_cs->first() && ext_cs->first()->head()->length() > 0) {
Wrapped_Selector_Ptr ext_ws = Cast<Wrapped_Selector>(ext_cs->first()->head()->first());
Compound_Selector_Obj ext_head = NULL;
if (ext_cs->first()) ext_head = ext_cs->first()->head();
if (ext_head && ext_head && ext_head->length() > 0) {
Wrapped_Selector_Ptr ext_ws = Cast<Wrapped_Selector>(ext_head->first());
if (ext_ws/* && ext_cs->length() == 1*/) {
Selector_List_Obj ws_cs = Cast<Selector_List>(ext_ws->selector());
Compound_Selector_Obj ws_ss = ws_cs->first()->head();
Expand Down

0 comments on commit 981dbeb

Please sign in to comment.