2 May 2002 14:59
Fix for 1001-local-eval-error-backtrace-segfaults - please review
Neil Jerram <neil <at> ossau.uklinux.net>
2002-05-02 12:59:06 GMT
2002-05-02 12:59:06 GMT
Patch
--- /home/neil/Guile/1.6/guile-core/libguile/eval.c.old Thu May 2 12:45:56 2002
+++ /home/neil/Guile/1.6/guile-core/libguile/eval.c Thu May 2 12:46:21 2002
<at> <at> -1417,7 +1417,9 <at> <at>
ls = scm_cons (scm_sym_define,
z = scm_cons (n = SCM_CAR (x), SCM_UNSPECIFIED));
if (SCM_NNULLP (env))
- SCM_SETCAR (SCM_CAR (env), scm_cons (n, SCM_CAR (SCM_CAR (env))));
+ env = scm_cons (scm_cons (scm_cons (n, SCM_CAAR (env)),
+ SCM_CDAR (env)),
+ SCM_CDR (env));
break;
}
case SCM_BIT8(SCM_MAKISYM (0)):
Diagnosis
If scm_unmemocopy is called (e.g. from scm_backtrace) to unmemoize an
expression that has an internal define (i.e. SCM_IM_DEFINE) near the
top level of the expression, the code in unmemocopy can modify the
expression passed in. The modification is such that an extra copy of
the symbol being defined is added on every call, thus:
(((args) 4) ...)
(((xxx args) 4) ...)
(((xxx xxx args) 4) ...)
and so on, and this modification eventually causes some other code
that looks at the environment to SEGV.
(Continue reading)
RSS Feed