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

fix alignment of subprograms of subprograms

* module/language/glil/compile-assembly.scm (glil->assembly)
  (dump-object): Fix an exciting bug! Subprograms of subprograms were
  not being aligned correctly, because the code was generated too early.
  So instead delay dumping the object table until the proper time.
This commit is contained in:
Andy Wingo 2009-07-26 11:54:05 +02:00
parent 9557ecc662
commit 9efc2d1404

View file

@ -175,7 +175,7 @@
;; anyway)
(emit-code (align-program prog addr)))
(else
(let ((table (dump-object (make-object-table objects) addr)))
(let ((table (make-object-table objects)))
(cond
(object-alist
;; if we are being compiled from something with an object
@ -190,8 +190,10 @@
object-alist)))
(else
;; otherwise emit a load directly
(emit-code `(,@table ,@(align-program prog (addr+ addr table))))))))))))
(let ((table-code (dump-object table addr)))
(emit-code
`(,@table-code
,@(align-program prog (addr+ addr table-code)))))))))))))
((<glil-bind> vars)
(values '()
@ -370,9 +372,10 @@
((object->assembly x) => list)
((variable-cache-cell? x) (dump-object (variable-cache-cell-key x) addr))
((subprogram? x)
`(,@(subprogram-table x)
(let ((table-code (dump-object (subprogram-table x) addr)))
`(,@table-code
,@(align-program (subprogram-prog x)
(addr+ addr (subprogram-table x)))))
(addr+ addr table-code)))))
((number? x)
`((load-number ,(number->string x))))
((string? x)