mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 13:30:26 +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:
parent
9557ecc662
commit
9efc2d1404
1 changed files with 9 additions and 6 deletions
|
@ -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)
|
||||
,@(align-program (subprogram-prog x)
|
||||
(addr+ addr (subprogram-table x)))))
|
||||
(let ((table-code (dump-object (subprogram-table x) addr)))
|
||||
`(,@table-code
|
||||
,@(align-program (subprogram-prog x)
|
||||
(addr+ addr table-code)))))
|
||||
((number? x)
|
||||
`((load-number ,(number->string x))))
|
||||
((string? x)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue