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

Fix bogus computation of `vm->stack_limit'.

* libguile/vm.c (make_vm): Remove bogus "- 3" when computing
  `stack_size'.

* libguile/vm-engine.h (CHECK_OVERFLOW): Change accordingly.
This commit is contained in:
Ludovic Courtès 2009-08-20 01:20:58 +02:00
parent 1f7de76940
commit 75d315e1fb
2 changed files with 2 additions and 2 deletions

View file

@ -252,7 +252,7 @@
#endif
#define CHECK_OVERFLOW() \
if (sp > stack_limit) \
if (sp >= stack_limit) \
goto vm_error_stack_overflow
#define CHECK_UNDERFLOW() \

View file

@ -298,7 +298,7 @@ make_vm (void)
#ifdef VM_ENABLE_STACK_NULLING
memset (vp->stack_base, 0, vp->stack_size * sizeof (SCM));
#endif
vp->stack_limit = vp->stack_base + vp->stack_size - 3;
vp->stack_limit = vp->stack_base + vp->stack_size;
vp->ip = NULL;
vp->sp = vp->stack_base - 1;
vp->fp = NULL;