diff options
author | Andy Wingo <wingo@pobox.com> | 2008-10-18 19:21:44 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2008-10-18 19:21:44 +0200 |
commit | 5e390de62f2355866e9bdad8b7aea4ac4080bdcd (patch) | |
tree | 9e4013d205e018aaf839e5a269a4355802720618 /module | |
parent | b3b45ac15ef508623dd9031f3c7e69dff7949801 (diff) | |
download | guile-5e390de62f2355866e9bdad8b7aea4ac4080bdcd.tar.gz |
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!
Diffstat (limited to 'module')
-rw-r--r-- | module/system/vm/assemble.scm | 5 | ||||
-rw-r--r-- | module/system/vm/disasm.scm | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/module/system/vm/assemble.scm b/module/system/vm/assemble.scm index 20ea7b5c1..26bc2727b 100644 --- a/module/system/vm/assemble.scm +++ b/module/system/vm/assemble.scm @@ -355,6 +355,11 @@ (push-code! `(make-int16 ,(ash x -8) ,(logand x (1- (ash 1 8))))))) (else ;; Other cases + (if (> (+ nargs nlocs) 255) + (error "too many locals" nargs nlocs)) + ;; really it should be a flag.. + (if (> nrest 1) (error "nrest should be 0 or 1" nrest)) + (if (> next 255) (error "too many externals" next)) (push-code! (object->code nargs)) (push-code! (object->code nrest)) (push-code! (object->code nlocs)) diff --git a/module/system/vm/disasm.scm b/module/system/vm/disasm.scm index 5ec1c004b..efb8ae396 100644 --- a/module/system/vm/disasm.scm +++ b/module/system/vm/disasm.scm @@ -109,7 +109,7 @@ (do ((n 0 (1+ n)) (l exts (cdr l))) ((null? l) (newline)) - (print-info n (car l) #f)))) + (print-info n (car l) #f #f)))) (define-macro (unless test . body) `(if (not ,test) (begin ,@body))) |