fix GC bug in FFI

Replicate e3eed89 for v5.3.6.
This commit is contained in:
Matthew Flatt 2013-07-16 14:29:34 -06:00 committed by Ryan Culpepper
parent e3e65a9cdf
commit a3a5a4e2e2
2 changed files with 10 additions and 0 deletions

View File

@ -3219,6 +3219,11 @@ Scheme_Object *ffi_do_call(int argc, Scheme_Object *argv[], Scheme_Object *self)
nargs, ivals, avalues,
offsets, p);
/* Use `data' to make sure it's kept alive (as far as the GC is concerned)
until the foreign call returns: */
if ((void*)data == (void*)scheme_true)
scheme_signal_error("dummy test suceeded!?");
if (save_errno != 0) save_errno_values(save_errno);
ivals = NULL; /* no need now to hold on to this */
for (i=0; i<nargs; i++) { avalues[i] = NULL; } /* no need for these refs */

View File

@ -2548,6 +2548,11 @@ Scheme_Object *ffi_do_call(int argc, Scheme_Object *argv[], Scheme_Object *self)
nargs, ivals, avalues,
offsets, p);
/* Use `data' to make sure it's kept alive (as far as the GC is concerned)
until the foreign call returns: */
if ((void*)data == (void*)scheme_true)
scheme_signal_error("dummy test suceeded!?");
if (save_errno != 0) save_errno_values(save_errno);
ivals = NULL; /* no need now to hold on to this */
for (i=0; i<nargs; i++) { avalues[i] = NULL; } /* no need for these refs */