summaryrefslogtreecommitdiff
path: root/src/compare.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/compare.cc')
-rw-r--r--src/compare.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compare.cc b/src/compare.cc
index 12114c7d..e2a298c2 100644
--- a/src/compare.cc
+++ b/src/compare.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2010, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2012, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -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;