shithub: femtolisp

Download patch

ref: 56cdb52a8ea9113e9a1d8d02656438e9d6ca950b
parent: 58ce0e39771b46ec93bc8295b93bc63ec0904729
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Fri Nov 29 22:56:02 EST 2024

compiler: builtin calls: fix broken check of arg count

--- a/compiler.lsp
+++ b/compiler.lsp
@@ -378,7 +378,7 @@
       (get b2i b #f))))
 
 (define (compile-builtin-call g env tail? x head b nargs)
-  (let ((count (get arg-counts head #f)))
+  (let ((count (get arg-counts b #f)))
     (if (and count
              (not (length= (cdr x) count)))
         (argc-error b count))
--- a/flisp.boot
+++ b/flisp.boot
@@ -130,7 +130,7 @@
   bcode:stack)) #fn(length)) compile-arglist)
 	    compile-begin #fn("9000n483H3?0700182715064:83=H3>070018283<64:7001O83<5447202352474018283=64:" #(compile-in
   void emit pop compile-begin) compile-begin)
-	    compile-builtin-call #fn("<000n7207184O538;;3=047283=8;52S3=073858;52@30D4858<24CK086El3:07502662:750858663:8<27C[086El3:07502862:86r2l3:07502962:750858663:8<2:Cj086El3:07385K62:86Kl3:07502;62:86r2l3:07502<62:750858663:8<2=CK086El3:07502>62:750858663:8<2?CK086El3:07385K62:750858663:8<2@CM086El3<07502A2B63:750858663:8<2CCW086r2L3;07385r262:750823702D@402C8663:7508562:" #(#fn(get)
+	    compile-builtin-call #fn("<000n7207185O538;;3=047283=8;52S3=073858;52@30D4858<24CK086El3:07502662:750858663:8<27C[086El3:07502862:86r2l3:07502962:750858663:8<2:Cj086El3:07385K62:86Kl3:07502;62:86r2l3:07502<62:750858663:8<2=CK086El3:07502>62:750858663:8<2?CK086El3:07385K62:750858663:8<2@CM086El3<07502A2B63:750858663:8<2CCW086r2L3;07385r262:750823702D@402C8663:7508562:" #(#fn(get)
   arg-counts length= argc-error list emit loadnil + load0 add2 - neg sub2 *
   load1 / vector loadv #() apply tapply) compile-builtin-call)
 	    compile-f #fn("8000n2702101>22262:" #(call-with-values #fn("7000n070AF62:" #(compile-f-))