mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
Fix error when argument to < not a real
* libguile/intrinsics.c (less_p): scm_nan_p raises an error if arg is not a real; guard.
This commit is contained in:
parent
83023160b1
commit
e0d022c347
1 changed files with 2 additions and 1 deletions
|
@ -291,7 +291,8 @@ less_p (SCM a, SCM b)
|
|||
return a_bits < b_bits ? SCM_F_COMPARE_LESS_THAN : SCM_F_COMPARE_NONE;
|
||||
}
|
||||
|
||||
if (scm_is_true (scm_nan_p (a)) || scm_is_true (scm_nan_p (b)))
|
||||
if ((SCM_REALP (a) && scm_is_true (scm_nan_p (a)))
|
||||
|| (SCM_REALP (b) && scm_is_true (scm_nan_p (b))))
|
||||
return SCM_F_COMPARE_INVALID;
|
||||
else if (scm_is_true (scm_less_p (a, b)))
|
||||
return SCM_F_COMPARE_LESS_THAN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue