1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 14:00:21 +02:00

revert part of 7ff017002d that caused missed references

* libguile/programs.c (scm_c_make_closure): If the program is actually
  not a program, abort. This can happen if GC misses a reference, as
  currently seems to happen.

* libguile/vm.c (vm_mark): Revert part of
  7ff017002d, which changed the call to
  scm_mark_locations. I'm 99% *sure* this is wrong, but it seems to
  prevent missed references when recompiling the .go files in guile
  itself. Needs revisiting soon, but for the time being we can go back to
  where we were a couple of days ago.

* libguile/vm-i-system.c (halt, vector, vector-mark): Sync the registers
  before calling into C, as it may GC.
This commit is contained in:
Andy Wingo 2008-09-28 23:08:14 +02:00
parent cda52b2fda
commit 877ffa3f9c
3 changed files with 6 additions and 1 deletions

View file

@ -90,6 +90,8 @@ SCM
scm_c_make_closure (SCM program, SCM external)
{
SCM prog = scm_c_make_program (0, 0, program);
if (!SCM_PROGRAM_P (program))
abort ();
*SCM_PROGRAM_DATA (prog) = *SCM_PROGRAM_DATA (program);
SCM_PROGRAM_DATA (prog)->external = external;
return prog;

View file

@ -64,6 +64,7 @@ VM_DEFINE_INSTRUCTION (halt, "halt", 0, 0, 0)
{
POP_LIST (nvalues);
POP (ret);
SYNC_REGISTER ();
ret = scm_values (ret);
}
@ -186,6 +187,7 @@ VM_DEFINE_INSTRUCTION (vector, "vector", 2, -1, 1)
unsigned l = FETCH ();
unsigned len = ((h << 8) + l);
POP_LIST (len);
SYNC_REGISTER ();
*sp = scm_vector (*sp);
NEXT;
}
@ -199,6 +201,7 @@ VM_DEFINE_INSTRUCTION (list_mark, "list-mark", 0, 0, 0)
VM_DEFINE_INSTRUCTION (vector_mark, "vector-mark", 0, 0, 0)
{
POP_LIST_MARK ();
SYNC_REGISTER ();
*sp = scm_vector (*sp);
NEXT;
}

View file

@ -331,7 +331,7 @@ vm_mark (SCM obj)
/* mark the stack conservatively */
scm_mark_locations ((SCM_STACKITEM *) vp->stack_base,
vp->sp - vp->stack_base + 1);
sizeof (SCM)*(vp->sp + 1 - vp->stack_base));
/* mark other objects */
for (i = 0; i < SCM_VM_NUM_HOOKS; i++)