fix bug introduced in the fluid commit
authorAndy Wingo <wingo@pobox.com>
Thu, 25 Sep 2008 09:04:35 +0000 (11:04 +0200)
committerAndy Wingo <wingo@pobox.com>
Thu, 25 Sep 2008 09:04:35 +0000 (11:04 +0200)
* 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

index e18f1af..161225b 100644 (file)
@@ -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