1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

fix nil handling in the vm

* libguile/vm-i-scheme.c (not, not-not): Treat nil as false.
  (null?, not-null?): Treat nil as null.

* libguile/vm-i-system.c (br-if, br-if-not): Treat nil as false.
  (br-if-null, br-if-not-null): Treat nil as null.
This commit is contained in:
Mark H Weaver 2009-10-27 22:59:22 +01:00 committed by Andy Wingo
parent 45f4cbdf12
commit b02b05332f
2 changed files with 8 additions and 8 deletions

View file

@ -475,12 +475,12 @@ VM_DEFINE_INSTRUCTION (34, br, "br", 3, 0, 0)
VM_DEFINE_INSTRUCTION (35, br_if, "br-if", 3, 0, 0)
{
BR (!SCM_FALSEP (*sp));
BR (scm_is_true_and_not_nil (*sp));
}
VM_DEFINE_INSTRUCTION (36, br_if_not, "br-if-not", 3, 0, 0)
{
BR (SCM_FALSEP (*sp));
BR (scm_is_false_or_nil (*sp));
}
VM_DEFINE_INSTRUCTION (37, br_if_eq, "br-if-eq", 3, 0, 0)
@ -497,12 +497,12 @@ VM_DEFINE_INSTRUCTION (38, br_if_not_eq, "br-if-not-eq", 3, 0, 0)
VM_DEFINE_INSTRUCTION (39, br_if_null, "br-if-null", 3, 0, 0)
{
BR (SCM_NULLP (*sp));
BR (scm_is_null_or_nil (*sp));
}
VM_DEFINE_INSTRUCTION (40, br_if_not_null, "br-if-not-null", 3, 0, 0)
{
BR (!SCM_NULLP (*sp));
BR (!scm_is_null_or_nil (*sp));
}