mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-11 22:31:12 +02:00
(unmemoize_delay): Extend the environment before
unmemoizing the promise thunk. This fixes a segmentation fault reported by Frank Schwidom.
This commit is contained in:
parent
dfdb8448a9
commit
9a79f394f9
2 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
2007-10-19 Neil Jerram <neil@ossau.uklinux.net>
|
||||
|
||||
* eval.c (unmemoize_delay): Extend the environment before
|
||||
unmemoizing the promise thunk. This fixes a segmentation fault
|
||||
reported by Frank Schwidom.
|
||||
|
||||
2007-10-17 Ludovic Courtès <ludo@gnu.org>
|
||||
|
||||
* read.c (CHAR_IS_BLANK_): Add `\r' (ASCII 0x0d). This fixes a
|
||||
|
|
|
@ -1288,7 +1288,13 @@ static SCM
|
|||
unmemoize_delay (const SCM expr, const SCM env)
|
||||
{
|
||||
const SCM thunk_expr = SCM_CADDR (expr);
|
||||
return scm_list_2 (scm_sym_delay, unmemoize_expression (thunk_expr, env));
|
||||
/* A promise is implemented as a closure, and when applying a
|
||||
closure the evaluator adds a new frame to the environment - even
|
||||
though, in the case of a promise, the added frame is always
|
||||
empty. We need to extend the environment here in the same way,
|
||||
so that any ILOCs in thunk_expr can be unmemoized correctly. */
|
||||
const SCM new_env = SCM_EXTEND_ENV (SCM_EOL, SCM_EOL, env);
|
||||
return scm_list_2 (scm_sym_delay, unmemoize_expression (thunk_expr, new_env));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue