From f63ea2ce78dffa006825f4d360eb36a590dcef24 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 25 Sep 2008 11:04:35 +0200 Subject: [PATCH] fix bug introduced in the fluid commit * libguile/vm.c (the-vm): If the dynamic binding of *the-vm* is false, make a new vm. Fixes multiple threads with the vm since the *the-vm* fluid changes. --- libguile/vm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libguile/vm.c b/libguile/vm.c index e18f1af6d..161225b14 100644 --- a/libguile/vm.c +++ b/libguile/vm.c @@ -380,7 +380,14 @@ SCM_DEFINE (scm_the_vm, "the-vm", 0, 0, 0, "") #define FUNC_NAME s_scm_the_vm { - return scm_fluid_ref (scm_the_vm_fluid); + SCM ret; + + if (SCM_NFALSEP ((ret = scm_fluid_ref (scm_the_vm_fluid)))) + return ret; + + ret = make_vm (); + scm_fluid_set_x (scm_the_vm_fluid, ret); + return ret; } #undef FUNC_NAME