Fix crash when cdr is a value type

This commit is contained in:
Justin Ethier 2016-05-03 00:10:59 -04:00
parent d77b94d89c
commit 730fdb3111

View file

@ -789,7 +789,7 @@ static object _Cyc_write(object x, FILE * port)
break;
}
for (tmp = cdr(x); tmp && ((closure) tmp)->tag == pair_tag; tmp = cdr(tmp)) {
for (tmp = cdr(x); tmp && !is_value_type(tmp) && ((closure) tmp)->tag == pair_tag; tmp = cdr(tmp)) {
if (has_cycle == boolean_t) {
if (i++ > 20)
break; /* arbitrary number, for now */