1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +02:00

Fix "VM never extends vp->sp ..." commit

* libguile/vm.c (vm_expand_stack): Make sure the new SP is visible to
  vm_error if we throw because of stack overflow.
This commit is contained in:
Andy Wingo 2014-02-20 10:43:40 +01:00
parent 24af549ac1
commit 2a62eda85a

View file

@ -1018,7 +1018,7 @@ vm_expand_stack (struct scm_vm *vp, SCM *new_sp)
SCM *fp; SCM *fp;
if (vp->fp) if (vp->fp)
vp->fp += reloc; vp->fp += reloc;
vp->sp_max_since_gc += reloc; new_sp += reloc;
fp = vp->fp; fp = vp->fp;
while (fp) while (fp)
{ {
@ -1031,10 +1031,10 @@ vm_expand_stack (struct scm_vm *vp, SCM *new_sp)
fp = next_fp; fp = next_fp;
} }
} }
new_sp += reloc;
} }
vp->sp_max_since_gc = vp->sp = new_sp;
if (stack_size >= vp->max_stack_size) if (stack_size >= vp->max_stack_size)
{ {
/* Expand the soft limit by 256K entries to give us space to /* Expand the soft limit by 256K entries to give us space to
@ -1055,7 +1055,6 @@ vm_expand_stack (struct scm_vm *vp, SCM *new_sp)
} }
/* Otherwise continue, with the new enlarged stack. */ /* Otherwise continue, with the new enlarged stack. */
vp->sp_max_since_gc = vp->sp = new_sp;
} }
static struct scm_vm * static struct scm_vm *