Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix endless loop comparing Selector_List to List #2526

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,10 @@ namespace Sass {
}

// Selector lists can be compared to comma lists
bool Selector_List::operator==(const Expression& rhs) const
bool Selector_List::operator== (const Expression& rhs) const
{
// solve the double dispatch problem by using RTTI information via dynamic cast
if (List_Ptr_Const ls = Cast<List>(&rhs)) { return *this == *ls; }
if (List_Ptr_Const ls = Cast<List>(&rhs)) { return *ls == *this; }
if (Selector_Ptr_Const ls = Cast<Selector>(&rhs)) { return *this == *ls; }
// compare invalid (maybe we should error?)
return false;
Expand Down