Skip to content

Commit

Permalink
Fix segfault when comparing pseudo selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyfer committed Jan 7, 2017
1 parent 2f3a704 commit b28de01
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,12 @@ namespace Sass {
bool Pseudo_Selector::operator< (const Pseudo_Selector& rhs) const
{
if (is_ns_eq(ns(), rhs.ns()) && name() == rhs.name())
{ return *(expression()) < *(rhs.expression()); }
{
String_Obj lhs_ex = expression();
String_Obj rhs_ex = rhs.expression();
if (rhs_ex && lhs_ex) return *lhs_ex < *rhs_ex;
else return lhs_ex < rhs_ex;
}
if (is_ns_eq(ns(), rhs.ns()))
{ return name() < rhs.name(); }
return ns() < rhs.ns();
Expand Down

0 comments on commit b28de01

Please sign in to comment.