fixing a bug in character-number comparison

This commit is contained in:
JeffBezanson 2011-12-14 06:57:25 +00:00
parent 3f4b26a46f
commit 3d25a1a672
1 changed files with 7 additions and 4 deletions

View File

@ -79,10 +79,13 @@ static value_t bounded_compare(value_t a, value_t b, int bound, int eq)
return bounded_vector_compare(a, b, bound, eq);
break;
case TAG_CPRIM:
if (cp_class((cprim_t*)ptr(a)) == wchartype &&
(!iscprim(b) ||
cp_class((cprim_t*)ptr(b)) != wchartype))
return fixnum(-1);
if (cp_class((cprim_t*)ptr(a)) == wchartype) {
if (!iscprim(b) || cp_class((cprim_t*)ptr(b)) != wchartype)
return fixnum(-1);
}
else if (iscprim(b) && cp_class((cprim_t*)ptr(b)) == wchartype) {
return fixnum(1);
}
c = numeric_compare(a, b, eq, 1, NULL);
if (c != 2)
return fixnum(c);