From b02b05332f45fc6ac4f99556cda9fb7ee894e673 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 27 Oct 2009 22:59:22 +0100 Subject: 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. --- libguile/vm-i-system.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libguile/vm-i-system.c') diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index 160c231c8..f58ffce58 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -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)); } -- cgit v1.2.3