1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-30 17:00:23 +02:00

fix misallocation of some <fix> procedures

* module/language/tree-il/analyze.scm (analyze-lexicals): When stepping
  into a non-tail form, we know that labels allocation will be invalid,
  so use an empty labels set.  Fixes http://debbugs.gnu.org/9769.

* test-suite/tests/tree-il.test ("labels allocation"): Add a test.
This commit is contained in:
Andy Wingo 2011-10-20 23:50:05 +02:00
parent 3e54fdfc21
commit aa9c198588
2 changed files with 14 additions and 1 deletions

View file

@ -171,7 +171,7 @@
;; returns variables referenced in expr
(define (analyze! x proc labels-in-proc tail? tail-call-args)
(define (step y) (analyze! y proc labels-in-proc #f #f))
(define (step y) (analyze! y proc '() #f #f))
(define (step-tail y) (analyze! y proc labels-in-proc tail? #f))
(define (step-tail-call y args) (analyze! y proc labels-in-proc #f
(and tail? args)))

View file

@ -624,6 +624,19 @@
(toplevel ref bar) (call call/cc 1)
(call tail-call 1))))
(with-test-prefix "labels allocation"
(pass-if "http://debbugs.gnu.org/9769"
((compile '(lambda ()
(let ((fail (lambda () #f)))
(let ((test (lambda () (fail))))
(test))
#t))
;; Prevent inlining. We're testing analyze.scm's
;; labels allocator here, and inlining it will
;; reduce the entire thing to #t.
#:opts '(#:partial-eval? #f)))))
(with-test-prefix "partial evaluation"