summaryrefslogtreecommitdiff
path: root/module/language/tree-il/compile-bytecode.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2020-05-11 13:31:40 +0200
committerAndy Wingo <wingo@pobox.com>2020-05-11 13:31:40 +0200
commit527262fef0f5bb21f11ff1b24503b6f54f127260 (patch)
treee24176011ef96381f47ffe867bc1721747f5c963 /module/language/tree-il/compile-bytecode.scm
parentc0a27de50dce17624fb7541a6f2603a5ecf2b214 (diff)
downloadguile-527262fef0f5bb21f11ff1b24503b6f54f127260.tar.gz
Fix baseline compilation error for make-struct/simple
* module/language/tree-il/compile-bytecode.scm (compile-closure): $allocate-struct takes an SCM.
Diffstat (limited to 'module/language/tree-il/compile-bytecode.scm')
-rw-r--r--module/language/tree-il/compile-bytecode.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/module/language/tree-il/compile-bytecode.scm b/module/language/tree-il/compile-bytecode.scm
index 6e12a52a5..c8ecf538e 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)