From 527262fef0f5bb21f11ff1b24503b6f54f127260 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Mon, 11 May 2020 13:31:40 +0200 Subject: [PATCH] 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 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))) (($ src name args)