From 5e390de62f2355866e9bdad8b7aea4ac4080bdcd Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 18 Oct 2008 19:21:44 +0200 Subject: fix bug in self-tail-recursion with "external" variables; other sundries * gdbinit (pp, inst): New commands. * libguile/vm-engine.c (vm_error_not_a_pair): New error case. * libguile/vm-i-scheme.c (VM_VALIDATE_CONS): New macro -- use this instead of SCM_VALIDATE_* because SCM_VALIDATE will exit nonlocally before we have a chance to sync the regs. (car, cdr, set-car, set-cdr): Use VM_VALIDATE_CONS. * libguile/vm-i-system.c (goto/args): Bugfix: when doing a self-tail-recursion, allocate fresh externals. Fixes use of match.go. * module/system/vm/assemble.scm (dump-object!): Add some checks that we aren't dumping out values that the VM can't handle. * module/system/vm/disasm.scm (disassemble-externals): Fix rotten call to `print-info'. * oop/goops/dispatch.scm: Add a FIXME. * testsuite/Makefile.am (vm_test_files): * testsuite/t-closure4.scm (extract-symbols): New test, distilled with much effort out of match.scm. * ice-9/Makefile.am (NOCOMP_SOURCES): Re-enable compilation of match.scm. Yay! --- libguile/vm-i-system.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libguile/vm-i-system.c') diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index fbb94c89a..2da2d4249 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -621,7 +621,13 @@ VM_DEFINE_INSTRUCTION (goto_args, "goto/args", 1, -1, 1) /* Drop the first argument and the program itself. */ sp -= 2; - NULLSTACK (bp->nargs + 1) + NULLSTACK (bp->nargs + 1); + + /* Freshen the externals */ + external = bp->external; + for (i = 0; i < bp->nexts; i++) + CONS (external, SCM_UNDEFINED, external); + SCM_FRAME_DATA_ADDRESS (fp)[0] = external; /* Call itself */ ip = bp->base; -- cgit v1.2.3