c stack overflow checked for, once more
authorAndy Wingo <wingo@pobox.com>
Fri, 1 Oct 2010 14:47:39 +0000 (16:47 +0200)
committerAndy Wingo <wingo@pobox.com>
Fri, 1 Oct 2010 14:47:39 +0000 (16:47 +0200)
* libguile/stackchk.h: Include private-options.h if we are building
  guile.

* libguile/vm.c (scm_c_vm_run): Check for C stack overflow before
  entering the engine.

libguile/stackchk.h
libguile/vm.c

index 68dec76..aa6a1d4 100644 (file)
@@ -35,6 +35,7 @@
 #define SCM_STACK_CHECKING_P SCM_STACK_LIMIT
 
 #if defined BUILDING_LIBGUILE && defined STACK_CHECKING
+#include "libguile/private-options.h"
 # if SCM_STACK_GROWS_UP
 #  define SCM_STACK_OVERFLOW_P(s)\
    ((SCM_STACK_PTR (s) - SCM_I_CURRENT_THREAD->base) > SCM_STACK_LIMIT)
index 29d6862..58d9a9f 100644 (file)
@@ -560,6 +560,7 @@ SCM
 scm_c_vm_run (SCM vm, SCM program, SCM *argv, int nargs)
 {
   struct scm_vm *vp = SCM_VM_DATA (vm);
+  SCM_CHECK_STACK;
   return vm_engines[vp->engine](vm, program, argv, nargs);
 }