guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 02/09: Fix baseline compilation error for make-struct/si


From: Andy Wingo
Subject: [Guile-commits] 02/09: Fix baseline compilation error for make-struct/simple
Date: Mon, 11 May 2020 09:08:26 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 527262fef0f5bb21f11ff1b24503b6f54f127260
Author: Andy Wingo <address@hidden>
AuthorDate: Mon May 11 13:31:40 2020 +0200

    Fix baseline compilation error for make-struct/simple
    
    * module/language/tree-il/compile-bytecode.scm (compile-closure):
      $allocate-struct takes an SCM.
---
 module/language/tree-il/compile-bytecode.scm | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/module/language/tree-il/compile-bytecode.scm 
b/module/language/tree-il/compile-bytecode.scm
index 6e12a52..c8ecf53 100644
--- a/module/language/tree-il/compile-bytecode.scm
+++ b/module/language/tree-il/compile-bytecode.scm
@@ -1142,12 +1142,14 @@ in the frame with for the lambda-case clause 
@var{clause}."
              ('make-struct/simple
               (match args
                 ((vtable . args)
-                 (let ((len (length args)))
-                   (emit-$allocate-struct asm 0 vtable len)
-                   (let lp ((i 0) (args args))
-                     (when (< i len)
-                       (emit-struct-init! asm 0 i (car args) 1)
-                       (lp (1+ i) (cdr args)))))))))
+                 (emit-load-constant asm 0 (length args))
+                 (emit-$allocate-struct asm 0 vtable 0)
+                 (let lp ((i 0) (args args))
+                   (match args
+                     (() #t)
+                     ((arg . args)
+                      (emit-struct-init! asm 0 i arg 1)
+                      (lp (1+ i) args))))))))
            (emit-mov asm dst 0)))
 
         (($ <primcall> src name args)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]