diff options
author | Ludovic Courtès <ludo@gnu.org> | 2010-03-15 15:39:43 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2010-03-15 15:39:43 +0100 |
commit | 9823fd399c4addd852409c20e3112e62dca0a937 (patch) | |
tree | 87cc39a1423fad50bbf9045162d41c0fbe1fef9d /libguile/vm-engine.h | |
parent | deec8986ff889724a6fa3fdd9d5e7221473956fe (diff) | |
download | guile-9823fd399c4addd852409c20e3112e62dca0a937.tar.gz |
Make sure the whole VM stack is always scanned by the GC.
Thanks to Andy for noticing this.
* libguile/vm-engine.h (SYNC_REGISTER, CACHE_REGISTER): Add comment.
* libguile/vm-i-scheme.c (make_struct): Call `SYNC_REGISTER ()' in all
cases since the GC is going to run.
(struct_ref, struct_set): Call `SYNC_REGISTER ()' on the slow path.
(BV_REF_WITH_ENDIANNESS, BV_FIXABLE_INT_REF, BV_INT_REF): Likewise.
(BV_FLOAT_REF): Always `SYNC_REGISTER ()'.
Diffstat (limited to 'libguile/vm-engine.h')
-rw-r--r-- | libguile/vm-engine.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libguile/vm-engine.h b/libguile/vm-engine.h index ccc1408d9..66e03c8b1 100644 --- a/libguile/vm-engine.h +++ b/libguile/vm-engine.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2009, 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 @@ -102,6 +102,7 @@ #endif +/* Cache the VM's instruction, stack, and frame pointer in local variables. */ #define CACHE_REGISTER() \ { \ ip = vp->ip; \ @@ -109,6 +110,9 @@ fp = vp->fp; \ } +/* Update the registers in VP, a pointer to the current VM. This must be done + at least before any GC invocation so that `vp->sp' is up-to-date and the + whole stack gets marked. */ #define SYNC_REGISTER() \ { \ vp->ip = ip; \ |