guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-12-117-gb


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-12-117-gb95d76f
Date: Fri, 01 Oct 2010 14:44:24 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=b95d76fcf28fe2b10985daba3dff91281846f879

The branch, master has been updated
       via  b95d76fcf28fe2b10985daba3dff91281846f879 (commit)
       via  138bf22d8272fd1412bd522833dd252e791ad95d (commit)
      from  d0110327ab0c95f245d2e72846ed1f7661232f18 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b95d76fcf28fe2b10985daba3dff91281846f879
Author: Andy Wingo <address@hidden>
Date:   Fri Oct 1 16:47:39 2010 +0200

    c stack overflow checked for, once more
    
    * 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.

commit 138bf22d8272fd1412bd522833dd252e791ad95d
Author: Andy Wingo <address@hidden>
Date:   Fri Oct 1 16:36:34 2010 +0200

    scm_report_stack_overflow eventually resets scm_stack_checking_enabled_p
    
    * libguile/stackchk.c (scm_report_stack_overflow): Surround in a
      dynwind, so that scm_stack_checking_enabled_p is reset when the error
      throws.

-----------------------------------------------------------------------

Summary of changes:
 libguile/stackchk.c |   18 +++++++++++++++++-
 libguile/stackchk.h |    1 +
 libguile/vm.c       |    1 +
 3 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/libguile/stackchk.c b/libguile/stackchk.c
index b14a712..6cfb783 100644
--- a/libguile/stackchk.c
+++ b/libguile/stackchk.c
@@ -1,4 +1,4 @@
-/*     Copyright (C) 1995,1996,1997, 2000, 2001, 2006, 2008 Free Software 
Foundation, Inc.
+/*     Copyright (C) 1995,1996,1997, 2000, 2001, 2006, 2008, 2010 Free 
Software Foundation, Inc.
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -26,6 +26,7 @@
 #include "libguile/ports.h"
 #include "libguile/root.h"
 #include "libguile/threads.h"
+#include "libguile/dynwind.h"
 
 #include "libguile/stackchk.h"
 
@@ -38,15 +39,30 @@ int scm_stack_checking_enabled_p;
 
 SCM_SYMBOL (scm_stack_overflow_key, "stack-overflow");
 
+static void
+reset_scm_stack_checking_enabled_p (void *arg)
+{
+  scm_stack_checking_enabled_p = (int)(scm_t_bits)arg;
+}
+
 void
 scm_report_stack_overflow ()
 {
+  scm_dynwind_begin (0); /* non-rewindable frame */
+  scm_dynwind_unwind_handler (reset_scm_stack_checking_enabled_p,
+                              (void*)(scm_t_bits)scm_stack_checking_enabled_p,
+                              SCM_F_WIND_EXPLICITLY);
+  
   scm_stack_checking_enabled_p = 0;
+
   scm_error (scm_stack_overflow_key,
             NULL,
             "Stack overflow",
             SCM_BOOL_F,
             SCM_BOOL_F);
+
+  /* not reached */
+  scm_dynwind_end ();
 }
 
 #endif
diff --git a/libguile/stackchk.h b/libguile/stackchk.h
index 68dec76..aa6a1d4 100644
--- a/libguile/stackchk.h
+++ b/libguile/stackchk.h
@@ -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)
diff --git a/libguile/vm.c b/libguile/vm.c
index 29d6862..58d9a9f 100644
--- a/libguile/vm.c
+++ b/libguile/vm.c
@@ -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);
 }
 


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]