fix ancient bugs related to unexpected GC while multiple-value results are waiting in the temporary buffer (which is flushed on GC)
svn: r3927
This commit is contained in:
parent
386b9c06a9
commit
8848d0dedd
12
src/configure
vendored
12
src/configure
vendored
|
@ -1680,11 +1680,13 @@ show_explicitly_enabled "${enable_xonx}" "X-on-X"
|
|||
show_explicitly_enabled "${enable_shared}" "Shared libraries"
|
||||
|
||||
show_explicitly_disabled "${enable_mred}" MrEd
|
||||
show_explicitly_disabled "${enable_gl}" OpenGL
|
||||
show_explicitly_disabled "${enable_xrender}" Xrender
|
||||
show_explicitly_disabled "${enable_cairo}" Cairo
|
||||
show_explicitly_disabled "${enable_libpng}" "Use-existing-libpng"
|
||||
show_explicitly_disabled "${enable_libjpeg}" "Use-existing-libjpeg"
|
||||
if test "${enable_mred}" != "no" ; then
|
||||
show_explicitly_disabled "${enable_gl}" OpenGL
|
||||
show_explicitly_disabled "${enable_xrender}" Xrender
|
||||
show_explicitly_disabled "${enable_cairo}" Cairo
|
||||
show_explicitly_disabled "${enable_libpng}" "Use-existing-libpng"
|
||||
show_explicitly_disabled "${enable_libjpeg}" "Use-existing-libjpeg"
|
||||
fi
|
||||
|
||||
if test "$LIBTOOLPROG" != "" ; then
|
||||
echo "=== Libtool program: $LIBTOOLPROG"
|
||||
|
|
|
@ -225,11 +225,13 @@ show_explicitly_enabled "${enable_xonx}" "X-on-X"
|
|||
show_explicitly_enabled "${enable_shared}" "Shared libraries"
|
||||
|
||||
show_explicitly_disabled "${enable_mred}" MrEd
|
||||
show_explicitly_disabled "${enable_gl}" OpenGL
|
||||
show_explicitly_disabled "${enable_xrender}" Xrender
|
||||
show_explicitly_disabled "${enable_cairo}" Cairo
|
||||
show_explicitly_disabled "${enable_libpng}" "Use-existing-libpng"
|
||||
show_explicitly_disabled "${enable_libjpeg}" "Use-existing-libjpeg"
|
||||
if test "${enable_mred}" != "no" ; then
|
||||
show_explicitly_disabled "${enable_gl}" OpenGL
|
||||
show_explicitly_disabled "${enable_xrender}" Xrender
|
||||
show_explicitly_disabled "${enable_cairo}" Cairo
|
||||
show_explicitly_disabled "${enable_libpng}" "Use-existing-libpng"
|
||||
show_explicitly_disabled "${enable_libjpeg}" "Use-existing-libjpeg"
|
||||
fi
|
||||
|
||||
if test "$LIBTOOLPROG" != "" ; then
|
||||
echo "=== Libtool program: $LIBTOOLPROG"
|
||||
|
|
|
@ -7373,6 +7373,8 @@ Scheme_Object **scheme_push_prefix(Scheme_Env *genv, Resolve_Prefix *rp,
|
|||
|
||||
void scheme_pop_prefix(Scheme_Object **rs)
|
||||
{
|
||||
/* This function must not allocate, since a relevant multiple-values
|
||||
result may be in the thread record (and we don't want it zerod) */
|
||||
MZ_RUNSTACK = rs;
|
||||
}
|
||||
|
||||
|
|
|
@ -1739,6 +1739,10 @@ void *top_level_do(void *(*k)(void), int eb, void *sj_start)
|
|||
|
||||
v = k();
|
||||
|
||||
/* IMPORTANT: no GCs from here to return, since v
|
||||
may refer to multiple values, and we don't want the
|
||||
multiple-value array cleared. */
|
||||
|
||||
p = scheme_current_thread;
|
||||
|
||||
p->current_local_env = save_current_local_env;
|
||||
|
|
|
@ -508,8 +508,11 @@ static void box_multiple_array_element(int pos)
|
|||
Scheme_Object **naya, **a;
|
||||
int i;
|
||||
|
||||
naya = MALLOC_N(Scheme_Object *, p->ku.multiple.count);
|
||||
a = p->ku.multiple.array;
|
||||
if (SAME_OBJ(a, p->values_buffer))
|
||||
p->values_buffer = NULL;
|
||||
|
||||
naya = MALLOC_N(Scheme_Object *, p->ku.multiple.count);
|
||||
|
||||
for (i = p->ku.multiple.count; i--; ) {
|
||||
naya[i] = a[i];
|
||||
|
|
|
@ -684,6 +684,9 @@ define_execute(Scheme_Object *vars, Scheme_Object *vals, int defmacro,
|
|||
|
||||
return scheme_void;
|
||||
}
|
||||
|
||||
if (SAME_OBJ(scheme_current_thread->ku.multiple.array, scheme_current_thread->values_buffer))
|
||||
scheme_current_thread->values_buffer = NULL;
|
||||
} else if (SCHEME_PAIRP(vars) && SCHEME_NULLP(SCHEME_CDR(vars))) {
|
||||
if (dm_env) {
|
||||
b = scheme_global_keyword_bucket(SCHEME_CAR(vars), dm_env);
|
||||
|
@ -2278,9 +2281,13 @@ bangboxvalue_execute(Scheme_Object *data)
|
|||
Scheme_Object **naya, **a;
|
||||
int i;
|
||||
|
||||
naya = MALLOC_N(Scheme_Object *, p->ku.multiple.count);
|
||||
a = p->ku.multiple.array;
|
||||
|
||||
if (SAME_OBJ(a, p->values_buffer))
|
||||
p->values_buffer = NULL;
|
||||
|
||||
naya = MALLOC_N(Scheme_Object *, p->ku.multiple.count);
|
||||
|
||||
for (i = p->ku.multiple.count; i--; ) {
|
||||
naya[i] = a[i];
|
||||
}
|
||||
|
@ -4571,15 +4578,21 @@ void scheme_bind_syntaxes(const char *where, Scheme_Object *names, Scheme_Object
|
|||
|
||||
a = eval_letmacro_rhs(a, rhs_env, ri->max_let_depth, rp, eenv->genv->phase, certs);
|
||||
|
||||
if (SAME_OBJ(a, SCHEME_MULTIPLE_VALUES))
|
||||
if (SAME_OBJ(a, SCHEME_MULTIPLE_VALUES)) {
|
||||
vc = scheme_current_thread->ku.multiple.count;
|
||||
else
|
||||
results = scheme_current_thread->ku.multiple.array;
|
||||
scheme_current_thread->ku.multiple.array = NULL;
|
||||
if (SAME_OBJ(results, scheme_current_thread->values_buffer))
|
||||
scheme_current_thread->values_buffer = NULL;
|
||||
} else {
|
||||
vc = 1;
|
||||
results = NULL;
|
||||
}
|
||||
|
||||
for (nc = 0, l = names; SCHEME_STX_PAIRP(l); l = SCHEME_STX_CDR(l)) {
|
||||
nc++;
|
||||
}
|
||||
|
||||
|
||||
if (vc != nc) {
|
||||
Scheme_Object *name;
|
||||
const char *symname;
|
||||
|
@ -4593,18 +4606,13 @@ void scheme_bind_syntaxes(const char *where, Scheme_Object *names, Scheme_Object
|
|||
|
||||
scheme_wrong_return_arity(where,
|
||||
nc, vc,
|
||||
(vc == 1) ? (Scheme_Object **)a : scheme_current_thread->ku.multiple.array,
|
||||
(vc == 1) ? (Scheme_Object **)a : results,
|
||||
"%s%s%s",
|
||||
name ? "defining \"" : "0 names",
|
||||
symname,
|
||||
name ? ((nc == 1) ? "\"" : "\", ...") : "");
|
||||
}
|
||||
|
||||
results = scheme_current_thread->ku.multiple.array;
|
||||
scheme_current_thread->ku.multiple.array = NULL;
|
||||
if (SAME_OBJ(results, scheme_current_thread->values_buffer))
|
||||
scheme_current_thread->values_buffer = NULL;
|
||||
|
||||
i = *_pos;
|
||||
for (j = 0, l = names; SCHEME_STX_PAIRP(l); l = SCHEME_STX_CDR(l), j++) {
|
||||
Scheme_Object *name, *macro;
|
||||
|
|
Loading…
Reference in New Issue
Block a user