1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 06:50:31 +02:00

fix compilation of functions with more than 255 local variables.

* module/language/glil/compile-assembly.scm (glil->assembly): Fix case
  where there are more than 255 local variables.  Whoops!
This commit is contained in:
Andy Wingo 2013-02-20 16:02:30 +01:00
parent e716f4410f
commit 90f51aba0d

View file

@ -597,33 +597,32 @@
(else (error "what" op))) (else (error "what" op)))
(let ((a (quotient index 256)) (let ((a (quotient index 256))
(b (modulo index 256))) (b (modulo index 256)))
`((,(case op (case op
((ref) ((ref)
(if boxed? (if boxed?
`((long-local-ref ,a ,b) `((long-local-ref ,a ,b)
(variable-ref)) (variable-ref))
`((long-local-ref ,a ,b)))) `((long-local-ref ,a ,b))))
((set) ((set)
(if boxed? (if boxed?
`((long-local-ref ,a ,b) `((long-local-ref ,a ,b)
(variable-set)) (variable-set))
`((long-local-set ,a ,b)))) `((long-local-set ,a ,b))))
((box) ((box)
`((make-variable) `((make-variable)
(variable-set) (variable-set)
(long-local-set ,a ,b))) (long-local-set ,a ,b)))
((empty-box) ((empty-box)
`((make-variable) `((make-variable)
(long-local-set ,a ,b))) (long-local-set ,a ,b)))
((fix) ((fix)
`((fix-closure ,a ,b))) `((fix-closure ,a ,b)))
((bound?) ((bound?)
(if boxed? (if boxed?
`((long-local-ref ,a ,b) `((long-local-ref ,a ,b)
(variable-bound?)) (variable-bound?))
`((long-local-bound? ,a ,b)))) `((long-local-bound? ,a ,b))))
(else (error "what" op))) (else (error "what" op)))))
,index))))
`((,(case op `((,(case op
((ref) (if boxed? 'free-boxed-ref 'free-ref)) ((ref) (if boxed? 'free-boxed-ref 'free-ref))
((set) (if boxed? 'free-boxed-set (error "what." glil))) ((set) (if boxed? 'free-boxed-set (error "what." glil)))