summaryrefslogtreecommitdiff
path: root/src/compare.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/compare.cc')
-rw-r--r--src/compare.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compare.cc b/src/compare.cc
index 12114c7d..cdc96a86 100644
--- a/src/compare.cc
+++ b/src/compare.cc
@@ -44,7 +44,7 @@ void push_sort_value(std::list<sort_value_t>& sort_values,
if (node->kind == expr_t::op_t::O_CONS) {
while (node && node->kind == expr_t::op_t::O_CONS) {
push_sort_value(sort_values, node->left(), scope);
- node = node->right();
+ node = node->has_right() ? node->right() : NULL;
}
} else {
bool inverted = false;